Rahul Sethuram
1 min readApr 15, 2020

--

A huge problem with forEach is that async/await does not work the way you might expect. The callback will not wait for the promise to resolve before running on the next loop item. Because of this, I use for…of almost everywhere, except when I want to purposely run concurrently, in which case I use await Promise.all(map(...)) .

--

--

Rahul Sethuram
Rahul Sethuram

Written by Rahul Sethuram

CTO @ConnextProject. Full-stack web + blockchain developer. Interested in cutting-edge tech, investing, sports, and fitness. BJJ enthusiast.

Responses (1)