弱弱问句,这样封装有意义么,定义后控制不了后面的修改,如果JS支持宏就不用那么麻烦了。
用對象封裝較好。
[quote=引用 8 楼 thewallhz 的回复:] [quote=引用 1 楼 jslang 的回复:] var MyConstants = { Type0:0, Type1:1, Type2:2 }
var MyConstants = { Type0:0, Type1:1, Type2:2 }
[quote=引用 1 楼 jslang 的回复:] var MyConstants = { Type0:0, Type1:1, Type2:2 }
[quote=引用 2 楼 hch126163 的回复:] var type={Type0:0,Type1:1,Type2:2}; alert(type.Type0);
var type={Type0:0,Type1:1,Type2:2}; alert(type.Type0);
87,910
社区成员
224,616
社区内容
加载中
试试用AI创作助手写篇文章吧