forEach is BAD! for Async Await Code | Advanced Async/Await Javascript Tutorial

Published: 02 November 2021
on channel: Dave Gray
71,715
2.7k

Web Dev Roadmap for Beginners (Free!): https://bit.ly/DaveGrayWebDevRoadmap

Attempting to use Async / Await with forEach is a bad idea. In this advance async/await Javascript tutorial, I'll show you why. You will learn how for, for...of, Promise.all(), and reduce all provide alternative solutions that are better than forEach.

🚩 Subscribe ➜ https://bit.ly/3nGHmNn

🚀 This tutorial is part of an Advanced Javascript Concepts tutorial series playlist:
   • Advanced Javascript Concepts  

Async Await with forEach is BAD! | Advanced Async/Await Javascript Tutorial

(00:00) Intro
(00:05) Welcome and Intro
(00:22) forEach - What's it good for?
(02:34) Async fetch request example
(03:51) forEach with Async Await is BAD
(07:33) Alternative #1: traditional for loop
(09:39) Alternative #2: for...of loop
(10:39) Alternative #3: Promise.all with map
(14:01) Alternative #4: A different reduce

📚 References:
MDN forEach:
https://developer.mozilla.org/en-US/d...
MDN for...of:
https://developer.mozilla.org/en-US/d...
MDN PromiseAll:
https://developer.mozilla.org/en-US/d...
MDN reduce:
https://developer.mozilla.org/en-US/d...

✅ Follow Me:
Twitter:   / yesdavidgray  
LinkedIn:   / davidagray  
Blog: https://yesdavidgray.com
Reddit:   / daveoneleven  

Was this tutorial about why forEach is not for use with Async/Await in Javascript helpful? If so, please share. Let me know your thoughts in the comments.

#foreach #async #await


On this page of the site you can watch the video online forEach is BAD! for Async Await Code | Advanced Async/Await Javascript Tutorial with a duration of hours minute second in good quality, which was uploaded by the user Dave Gray 02 November 2021, share the link with friends and acquaintances, this video has already been watched 71,715 times on youtube and it was liked by 2.7 thousand viewers. Enjoy your viewing!