第 10 题:异步笔试题,请写出下面代码的运行结果
async function async1() {
console.log('async1 start');
await async2();
console.log('async1 end');
}
async function async2() {
console.log('async2');
}
console.log('script start');
setTimeout(function() {
console.log('setTimeout');
}, 0)
async1();
new Promise(function(resolve) {
console.log('promise1');
resolve();
}).then(function() {
console.log('promise2');
});
console.log('script end');
详细解析入口,新增答案入口:第 10 题
公司:头条
关注微信视频号 提升思维,更多干货 解说 

上下班路上刷一点 提前准备半年 进大厂 

加入前端进阶交流群 扫码回复 加群 进面试互助群 

看完两件小事
如果你觉得这道面试题对你挺有帮助,我想请你帮我两个小忙: