JSFiddle - React, Tailwind, and code Playground
HTML
Products:
<ul id='products'>
</ul>
JavaScript
var Shirt = function() {
this.basePrice = 1;
}
Shirt.prototype.getPrice = function(){return this.basePrice};
Shirt.prototype.display = function(){
$('ul#products').append('<li>Product: $' + this.getPrice() + '.00</li>');
};
var ExpensiveShirt = function() {
this.basePrice = 5;
};
ExpensiveShirt.prototype = Object.create(Shirt);
//TShirt.prototype.getPrice = Shirt.prototype.getPrice;
//TShirt.prototype.display = Shirt.prototype.display;
var s = new Shirt();
s.display();
console.log(s.getPrice());
var e = new ExpensiveShirt();
e.display();
console.log(e.getPrice());