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(...))
.