// supcalss var parent = function(name,age){ this.name = name; this.age = age; } parent.prototype.showProper = function() { console.log(this.name+":"+this.age); } var child = function(name,age){ parent.call(this,name,age); } // inheritance child.prototype = Object.create(parent.prototype); // child.prototype = new parent(); child.prototype.constructor = child; // rewrite function child.prototype.showProper = function(){ console.log('I am '+this.name+":"+this.age); } var obj = new child('wozien','22'); obj.showProper();