我在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();
Run Code Online (Sandbox Code Playgroud)
所以..当我使用'call'作为humanWithHand.call(this)时,内部会发生什么?
humanWithHand变量(或点?)将其属性和成员复制到人类变量的原型中?