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指向谁?
添加回答
举报
0/150
提交
取消