我正在使用caolan的async.js库,特别是.each方法.
如何访问迭代器中的索引?
async.each(ary, function(element, callback){
//do stuff here for each element in ary
//how do I get access to the index?
}, function(err) {
//final callback here
})
Run Code Online (Sandbox Code Playgroud)