DevilRoshan / Question

前端问题解决
0 stars 0 forks source link

[Daily]以下代码的输出 #89

Closed DevilRoshan closed 4 years ago

DevilRoshan commented 4 years ago
// 以下代码的输出
async function fn(){
  await new Promise((reslove) => {
    reslove('aaa')
  })
  return 'bbbb'
}

async function func() {
  let a = await fn().then((res) => res);
  console.log(a)
}

func()
DevilRoshan commented 4 years ago

https://github.com/DevilRoshan/Question/blob/master/20200725-js-promise-2.md