在ES6 Promise中,如果不返回新的Promise,则会同步调用“ then”处理程序

时间:2019-10-15 14:41:34

标签: javascript ecmascript-6 promise es6-promise

如果我在ES6中具有以下代码,其中“ then”处理程序不返回新的Promise,将同时调用两个“ then”处理程序,还是将每个新的“ then”处理程序一个又一个地异步调用?

Promise.resolve()
  .then(() => {console.log(1)})
  .then(() => {console.log(2)})

0 个答案:

没有答案