Async await代码输出——面试题
async await代码输出——面试题
先甩一段代码到你脸上,来看看你的答案是什么?
例子1
来请开始你的表演,默默在自己的小本本上记下以下这段代码的输出答案。
// 说出下面代码的输出
async function async1() {
console.log('async1 start');
await async2();
console.log('async1 end');
}
async function async2() {
console.log('async2');
}
console.log('script start')
async1();
new Promise(function (resolve