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();
this指向

Student{}类,这个你可以在superSay.call(this)上面加一行console.log(this)进行验证。然后,我们看这个代码
为了方便后面解释,我把这里的
new People()创建的实例称为实例X。由于
superSay = Student.prototype.say,因为上面的Student.prototype = new People();,所以其中Student.prototype为实例X。所以实际上
superSay调用的是实例X的say,而并非People.prototype.say。至于你为啥觉得是在调用
People.prototype.say,主要还是原型链的问题。实例X是People类的一个实例,所以实例X的所有方法会从People类的原型链“继承”(用继承这个词,但是实际上JS的原型链和继承还是有些区别的)。所以实例X.say如果没有针对实例X重写say方法,那么实例X的say就和People.prototype.say等效。另外,
superSay.call(this)这个里面的call,只是改变了this的上下文而已。但是由于superSay即实例X.say,这个方法里根本没有this,所以this上下文的修改并不影响运行的结果。