1const dummyfunction = async () => {
2 for (item of items) {
3 // Until promise returns,
4 // The loop waits here!
5 await turtle();
6 }
7}
1const mapLoop = async _ => {
2 console.log('Start')
3
4 const numFruits = await fruitsToGet.map(async fruit => {
5 const numFruit = await getNumFruit(fruit)
6 return numFruit
7 })
8
9 console.log(numFruits)
10
11 console.log('End')
12}
13