var A = function()
{
this.initialize.apply(this , arguments);
//这里apply调用的是prototype中的initialize为什么不调用这个initialize而死循环呢?
};
A.prototype=
{
initialize:function(v){this.value=v;},
showValue:function(){alert(this.value);}
}
var a = new A('helloWord!');//实例化一个A的对象a
a.showValue("helloWorld");
{
this.initialize.apply(this , arguments);
//这里apply调用的是prototype中的initialize为什么不调用这个initialize而死循环呢?
};
A.prototype=
{
initialize:function(v){this.value=v;},
showValue:function(){alert(this.value);}
}
var a = new A('helloWord!');//实例化一个A的对象a
a.showValue("helloWorld");
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货