为什么这句superSay.call(this);就可以让浏览器先提示"Hello",然后再"stu-Hello"呢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); alert("stu-Hello");}var s = new Student();s.say();
添加回答
举报
0/150
提交
取消