看不太懂啊,谁能详细解释哈子

Debug_mq 2007-04-04 04:12:53
var Enumerable = {
each: function(iterator) {
var index = 0;
try {
this._each(function(value) {
try {
iterator(value, index++);
} catch (e) {
if (e != $continue) throw e;
}
});
} catch (e) {
if (e != $break) throw e;
}
},

从哪里可以看出
每个元素都执行一次,在执行过程中,如果遇一到符合条件的元素,终止程序???

all: function(iterator) {
var result = true;
this.each(function(value, index) {
result = result && !!(iterator || Prototype.K)(value, index);
if (!result) throw $break;
});
return result;
},


上面这个方法怎么调用的each


each里面的function()是什么意思
...全文
183 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
左大神在这 2007-04-04
  • 打赏
  • 举报
回复
up

52,797

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ajax
社区管理员
  • Ajax
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧