流浪のwolf

卷帝

导航

等待函数

const wait = (ms) => new Promise((resolve)=> setTimeout(resolve, ms))

const asyncFn = async () => {
  await wait(1000)
  console.log('等待异步函数执行结束')
}

 

posted on 2023-06-30 19:42  朱龙旭的网络  阅读(8)  评论(0)    收藏  举报