📜  一一运行promise - Javascript代码示例

📅  最后修改于: 2022-03-11 15:04:28.259000             🧑  作者: Mango

代码示例1
function runSerial(tasks) {
  var result = Promise.resolve();
  tasks.forEach(task => {
    result = result.then(() => task());
  });
  return result;
}