Skip to content

Instantly share code, notes, and snippets.

View codewithali9's full-sized avatar
🏠
Working from home

codewithali9 codewithali9

🏠
Working from home
  • Cairo, Egypt
View GitHub Profile
@joeytwiddle
joeytwiddle / async-await-forEach-alternatives.md
Last active May 8, 2024 15:51
Do not use forEach with async-await

Do not use forEach with async-await

TLDR: Use for...of instead of forEach() in asynchronous code.

For legacy browsers, use for...i or [].reduce()

To execute the promises in parallel, use Promise.all([].map(...))

The problem