- JScript code
this.count=(function(innercount){ var incount=innercount; return { addNumber:function(num){ incount=incount+num; }, showNumber:function(){ return incount; } } })(0);
其他没有问题的啊
重要是这句showNumber:function() 重要的是这:是什么意思的啊
等同与function showNumber()吗????
谢谢
------解决方案--------------------------------------------------------
Asp.net(C#)高手交流群(39364250),欢迎高手加盟!
------解决方案--------------------------------------------------------
百度看看《悟透Javascript》吧
------解决方案--------------------------------------------------------
showNumber:function()
{
/*code*/
}
showNumber:是个类属性,但是这个属性比较特别,是一个方法。
可以这么调用:count.showNumber();
------解决方案--------------------------------------------------------
------解决方案--------------------------------------------------------
up
------解决方案--------------------------------------------------------
路过,捧个场
------解决方案--------------------------------------------------------
好像 是一样吧,