摘要: 1 // 用定时器处理数组 2 var items = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]; 3 4 function processArray(items, process, callback){ 5 var todo = items.concat(); // 克隆原数组 6 7 setTimeout(function(){ 8 process(todo.shift()); // 取得数组的下个元素并进行处理 9 10 /... 阅读全文
posted @ 2013-09-29 14:29 楚玉 阅读(767) 评论(0) 推荐(0) 编辑