function People() {
}
People.prototype.say = function () {
alert("hello");
}
function Student() {
}
Student.prototype = new People();
var superSay = Student.prototype.say;
Student.prototype.say = function () {
superSay.call(this); // 为什么会是"hello"?
alert("stu-hello");
}
var s = new Student();
s.say();
superSay.call(this)为什么会是People.prototype.say函数被调用?this指向谁? 12345678_0001
12345678_0001 随时随地看视频慕课网APP
随时随地看视频慕课网APP
相关分类