我有一个关于JavaScript中“call”的问题。
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();
那么,当我使用'call'函数,将humanWithHand.call(this)传递进去时,内部会发生什么?
humanWithHand变量是否将其属性和成员复制(或指向)到human变量的原型中?