📜  异步 for 循环 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:01.255000             🧑  作者: Mango

代码示例3
const mapLoop = async _ => {
  console.log('Start')

  const numFruits = await fruitsToGet.map(async fruit => {
    const numFruit = await getNumFruit(fruit)
    return numFruit
  })

  console.log(numFruits)

  console.log('End')
}