function Person(myName,myAge) { // let per = new Object(); // let this = per; // this = stu; this.name = myName; // stu.name = myName; this.age = myAge; // stu.age = myAge; // return this; } Person.prototype.say = function () { console.log(this.name, this.age, this.score); } function Student(myName,myAge,myScore) { // let stu = new Object(); // let this = stu; Person.call(this, myName,myAge); // Person.call(stu) this.score = myScore; this.study = function () { console.log('day day up'); } // return this; } Student.prototype = new Person(); Person.prototype.constructor = Student;