async function init(){
   console.log(1)
   await sleep(1000)
   console.log(2)
}
function sleep(ms){
    return new Promise(resolve=>{
        setTimeout(resolve,ms)
    })
}

相关文章:

  • 2021-06-07
  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-20
  • 2021-04-01
  • 2022-12-23
猜你喜欢
  • 2021-12-22
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
  • 2022-12-23
相关资源
相似解决方案