JSFiddle - React, Tailwind, and code Playground
JavaScript
//Define the class Car
function Car(speed) {
//alert("Class CAR Instantiated");
this.speed = speed;
}
//Car.prototype.speedd= 'Car Speed';
Car.prototype.setSpeed = function(speed) {
this.speed = speed;
alert("Car speed changed"+speed+"value");
}
var car1 = new Car(40);
alert(car1.speedd)
var car2 = new Car(60);
alert(car2.speed)
car1.setSpeed(120);
car2.setSpeed(140);