浏览器里的微任务和任务是什么?
// next = [0, 4x, 1, 2, 3, 5, 6]
Promise.resolve()
.then(() => {
console.log(0);
return Promise.resolve('4x');
})
.then((res) => {console.log(res)})
Promise.resolve().then(() => {console.log(1);})
.then(() => {console.log(2);}, ()=>{console.log(2.1)})
.then(() => {console.log(3);})
.then(() => {console.log(5);})
.then(() => {console.log(6);})
Last updated
