為什么這句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();
js里面的call的問題
胡子哥哥
2018-12-21 19:14:46