【发布时间】:2011-11-08 02:21:42
【问题描述】:
我对 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();
所以..当我使用 'call' 作为 humanWithHand.call(this) 时,内部会发生什么?
humanWithHand 变量是否将其属性和成员复制(或指向?)到人类变量的原型?
【问题讨论】:
标签: javascript call