以下输出顺序多少 (setTimeout 与 promise 顺序)
更多描述
setTimeout(() => console.log(0));
new Promise((resolve) => {
console.log(1);
resolve(2);
console.log(3);
}).then((o) => console.log(o));
new Promise((resolve) => {
console.log(4);
resolve(5);
})
.then((o) => console.log(o))
.then(() => console.log(6));
Issue 欢迎在 Gtihub Issue 中回答此问题: Issue 396
1 => 3 => 4 => 2 => 5 => 6 => 0