async function async1() {
console.log("async1 start2");//2
await async2();//await后面的都为回调内容————微任务
console.log("asnyc1 end7");//7
}
async function async2() {
console.log("async2 3");//3
}
console.log("script start 1");//1
setTimeout(() => {
console.log("setTimeOut 8");//宏任务 //8
}, 0);
async1();
new Promise(function (reslove) {
console.log("promise1 4");//4
reslove();
}).then(function () {
console.log("promise2 6");//微任务 6
});
console.log("script end 5");//5
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3947.100 Safari/537.36"