foreach循環對異步的處理

list.forEach(function(item,index){異步

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

相關文章
相關標籤/搜索