Skip to main content

写出控制台打印的值

console.log('script start');

async function asyncA() {
await asyncB();
console.log('asyncA end');
};

async function asyncB() {
console.log('asyncB end');
};

asyncA()

setTimeout(() => {
console.log('setTimeout')
}, 0)

new Promise((resolve, reject) => {
console.log('promise start');
resolve()
})
.then(() => {
console.log('promise end')
})

console.log('script end')
script start
asyncB end
promise start
script end
asyncA end
promise end
setTimeout