// 定義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函數(shù)的作用 以及(this,firstname)兩個參數(shù)的含義?? this.subject = subject;};Student.prototype = Object.create(Person.prototype); // 這段不懂 請教
JS面向對象問題的請教!
ken0510
2016-10-18 11:37:31