JSFiddle - React, Tailwind, and code Playground
JavaScript
function Mammal(config) {
this.config = config;
}
Mammal.prototype.run = function () {
console.log(this.config["name"] + "is running!");
}
function Cat(config) {
// call parent constructor
Mammal.call(this, config);
}
Cat.prototype = Object.create(Mammal);
var felix = new Cat({
"name": "Felix"
});
felix.run();