// 定义Person构造器function Person(firstName) { this.firstName = firstName;}Person.prototype.walk = function(){ alert("I am walking!");};Person.prototype.sayHello = function(){ alert("Hello, I'm " + this.firstName);};function Student(firstName, subject) { Person.call(this, firstName);// 请教 call函数的作用 以及(this,firstname)两个参数的含义 this.subject = subject;};Student.prototype = Object.create(Person.prototype); // 这段不懂 请教
添加回答
举报
0/150
提交
取消