JSFiddle - React, Tailwind, and code Playground
JavaScript
function Animal(name){
this.name = name;
}
Animal.prototype.alertName = function(){
alert(this.name);
}
function Dog(name){
Animal.call(this, name);
this.collarText;
}
Dog.prototype = Object.create(Animal.prototype);
var doggi = new Dog("Mikki");
doggi.alertName();