function Parent(name, age){ this.name = name; this.age = age; this.play = function() { console.log("play"); } } Parent.prototype.say = function() { console.log(this.name); console.log(this.age); } function Child(){} Child.prototype = new Parent(); Child.prototype.constructor = Child; Child.prototype.name = 'fangsong'; Child.prototype.age = 19; const child = new Child(); child.say() child.play();