Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

async await forEach

// Array.prototype.forEach is not designed for asynchronous code.
// Instead use await Promise.all to process all in parallel if the order doesn't matter.
await Promise.all(array.map(async (element) => {
  await someFunction(element);
}))
Source by gist.github.com #
 
PREVIOUS NEXT
Tagged: #async #await #forEach
ADD COMMENT
Topic
Name
2+2 =