考察js的宏和微以及线程和任务
async function async1 () {
console.log('async1 start');
await async2()
await async3()
console.log('async1 end');
}
async function async2 () {
console.log('async2')
}
async function async3 () {
return new Promise(resolve => {
console.log('async3')
resolve()
})
}
async1()
console.log('script start')
setTimeout(() => {
console.log('setTimeout')
}, 0)
console.log('script end')

浙公网安备 33010602011771号