JSFiddle - React, Tailwind, and code Playground

by Gleb

JavaScript

var Parent = function (name) {
    this.meth1 = function () {
        console.log("Parent meth1 ", name);
    };
    this.meth2 =  function() { 
        console.log('Parent meth2 ', name);
    };
    return this;
}

var Child = function (name) {
       Parent.call(this,name);
       this.meth1 = function() {
          console.log(name);
    }    
}


childObj = new Child("bla");
childObj.meth1();
childObj.meth2();