首页 新闻 赞助 找找看

关于mootools的一个问题

0
悬赏园豆:30 [已解决问题] 解决于 2011-03-08 13:18

var enumerables = true;
for (var i in {toString: 1}) enumerables = null;
if (enumerables) enumerables = ['hasOwnProperty', 'valueOf', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'constructor'];

请问for (var i in {toString: 1}) enumerables = null;这一句是做什么用的?

为什么要重新处理Object中的方法?

if (enumerables) enumerables = ['hasOwnProperty', 'valueOf', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'constructor'];

望高人指点!

笨蛋的座右铭的主页 笨蛋的座右铭 | 初学一级 | 园豆:140
提问于:2010-10-28 02:24
< >
分享
最佳答案
-1

toString 是系统成员。

标准浏览器无法迭代Object成员。

这是为了检测是否支持迭代出系统成员。

收获园豆:30
xuld | 菜鸟二级 |园豆:494 | 2011-02-14 22:20
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册