js的执行机制
console.log('1');
async function async1() {
console.log('2');
await async2();
console.log('3');
}
async function async2() {
console.log('4');
}
setTimeout(function () {
console.log('5');
new Promise(function (resolve) {
console.log('6');
resolve();
}).then(function () {
console.log('7')
})
})
async1();
new Promise(function (resolve) {
console.log('8');
resolve();
}).then(function () {
console.log('9');
});
console.log('10');
这串代码的执行机制是怎么样的