Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

wait for loop to finish javascript

async function processArray(array) {
  // map array to promises
  const promises = array.map(delayedLog);
  // wait until all promises are resolved
  await Promise.all(promises);
  console.log('Done!');
}
Source by lavrton.com #
 
PREVIOUS NEXT
Tagged: #wait #loop #finish #javascript
ADD COMMENT
Topic
Name
1+3 =