相关疑难解决方法(0)

async.js每个都在迭代器中得到索引

我正在使用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)

javascript asynchronous node-async

34
推荐指数
3
解决办法
3万
查看次数

标签 统计

asynchronous ×1

javascript ×1

node-async ×1