console.log(1);
setTimeout(() => {
console.log(2);
})
new Promise( () => {
console.log(3);
resolve();
}).then(() => {
console.log(4);
})
console.log(5);
// 1 3 5 2
手写面试题-定时器promise执行顺序
最新推荐文章于 2024-07-21 10:17:51 发布