DEV Community

Discussion on: Breaking down confusion of combining Async/Await with Array.forEach()

Collapse
 
jdforsythe profile image
Jeremy Forsythe

It is for this reason that we prefer for..of over .forEach when working with async. In most cases you're iterating an array and doing something async, you probably want .map() and Promise.all() but in instances you really do want the .forEach() behavior, use for..of instead

Collapse
 
dinos_vl profile image
Dinos Vlachantonis

Totally agree!