JSFiddle - React, Tailwind, and code Playground
JavaScript
function Car(name) {
this.Name = name;
console.log(this);
this.Year = 1999;
}
Car.prototype.Drive = function() {
document.write("My name is '" + this.Name + "' and my year is '" + this.Year + "'. <br />");
};
function SuperCar(name) {
console.log(name);
Car.call(this, name);
}
SuperCar.prototype = new Car();
var MyCar = new Car("mycar");
var MySuperCar = new SuperCar("my super car");
MyCar.Drive();
MySuperCar.Drive();
console.log(MySuperCar);