DEV Community

Discussion on: Async/Await and the forEach Pit of Despair

Collapse
 
scrwd profile image
Jon 🇪🇺 • Edited

await Promise.all(data.map(async () => { .... } )) proves to be more performant in my case - because it runs them all asynchronously and then resolves the list in the correct order as opposed to the for of loop which awaits on each iteration of the loop - making it slower because things don't run in parallel ...I think

Collapse
 
_bigblind profile image
Frederik 👨‍💻➡️🌐 Creemers

You can use backticks "``" around in-line source code to improve the formatting. Just a heads-up. Also since this seems to be your first comment on DEV.to, welcome!