JSFiddle - React, Tailwind, and code Playground
JavaScript
function Vehicle(make, model, color) {
this.make = make;
this.model = model;
this.color = color;
}
Vehicle.prototype = {
constructor: Vehicle,
getColor: function() {
return this.color;
},
setColor: function(color) {
this.color = color;
}
};
function Test() {
this.color = Vehicle.color;
return this.color;
}
var car = new Vehicle('chevy', 'cruze', 'black');