Answers for "loop with await in js"

4

loop with await in js

const dummyfunction = async () => {
	for (item of items) {
      	// Until promise returns,
      	// The loop waits here!
      	await turtle();
    }
}
Posted by: Guest on June-21-2021
-2

loop async javascript

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')
}
Posted by: Guest on July-03-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language