JSFiddle - React, Tailwind, and code Playground

by tonyleeper

JavaScript

var inherits = function (Constructor, Super) {
    Constructor.prototype = new Super();
    Constructor.prototype.constructor = Constructor;
}

var Animal = function () {
    
};
Animal.prototype.talk = function () {
    alert('what does the animal say?');
};

var Fox = function () {
    Animal.call(this);
    this.talk();
};
inherits(Fox, Animal);

Fox.prototype.talk = function () {
    alert('what does the fox say?');
};


var foxy = new Fox();