Why does async/await in a .forEach not actually await?

added by JavaScript Kicks
1/28/2019 8:41:03 AM

242 Views

If you're trying to loop over a list while using async/await in Node.js (or the browser, for that matter), reaching for the .forEach array function might seem like a natural choice. Let's say you go that route, fire up your tests or your application, and expect the synchronous-reading magic of async/await to do what it says and actually await the promise.


0 comments