foreach循环对异步的处理

list.forEach(function(item,index){

  var sendData = function(index, message) {
    setTimeout(function() {
      sync(); //异步方法
    }, 200*index);
  }
  sendData(index, message)
})

posted @ 2017-06-01 16:27  我叫阿良❤善良的良  阅读(449)  评论(0)    收藏  举报