📜  然后 js - Javascript 代码示例

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

代码示例2
new Promise( (res, rej) => {
  setTimeout(() => res(1), 1000);
}).then( (res) => {
  console.log(res); // 1
  return res*2
}).then( (res) => {
  console.log(res); // 2
});