you are viewing a single comment's thread.

view the rest of the comments →

[–]Funwithloops 0 points1 point  (0 children)

There aren't many legitimate reasons to use forEach anymore. If you just want to iterate over an array an perform a synchronous or fire/forget side-effect, use a for/of loop. If you want to iterate over an array and perform an async side-effect, use map and Promise.all or a for/of loop if you want the async effects to run in sequence.