JSFiddle - React, Tailwind, and code Playground
JavaScript
function Apple (color, size){
this.color = color;
this.size = size;
}
Apple.prototype = {
printMe: function(){
console.log('color: ' + this.color + ", size: " + this.size);
}
}
var greenApple = new Apple('green', 40);
var redApple = new Apple('red', 50);
greenApple.printMe();
redApple.printMe();