我有一个关于JavaScript的'调用'的问题。'call'如何在JavaScript中工作?
var humanWithHand = function(){
this.raiseHand = function(){
alert("raise hand");
}
}
var humanWithFoot = function(){
this.raiseFoot = function(){
alert("raise foot");
}
}
var human = function(){
humanWithHand.call(this);
humanWithFoot.call(this);
}
var test = new human();
so..when我使用'call'作为humanWithHand.call(this),内部会发生什么?
是否将humanWithHand变量拷贝(或点?)的属性和成员赋值给人类变量的原型?
[MDN文档调用()](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/call) – epascarello