87,910
社区成员
发帖
与我相关
我的任务
分享
function Test(){
this.name = 'test';
}
Test.prototype.show = function(){}
var obj = new Object(); // (1)
(function(){
for(var p in Test.prototype){ // (2)
obj[p] = Test.prototype[p];
}
Test.call(this); // (3)
return this; // (4)
}).call(obj);// (1)中的让this指针指向obj