![How async/await runs inside forEach, and why it probably doesn't do what you expect : r/learnjavascript How async/await runs inside forEach, and why it probably doesn't do what you expect : r/learnjavascript](https://external-preview.redd.it/ov3ewQhF_v6QoVNAOf2xPZS2YitEKWCOxzSheeE1UQ4.png?width=640&crop=smart&format=pjpg&auto=webp&s=14ff16d1216bfa8d7cb622299f3d038bed53f6a5)
How async/await runs inside forEach, and why it probably doesn't do what you expect : r/learnjavascript
![anyone know why setTimeout in this example just waits 600 milliseconds and them logs everything at once instead of logging one then in 600 milliseconds it logs the next? my thinking was anyone know why setTimeout in this example just waits 600 milliseconds and them logs everything at once instead of logging one then in 600 milliseconds it logs the next? my thinking was](https://preview.redd.it/vpsicw9hnhr91.png?auto=webp&s=ac64178ec728e61ccc88c3b7dc5119d3c45136e5)
anyone know why setTimeout in this example just waits 600 milliseconds and them logs everything at once instead of logging one then in 600 milliseconds it logs the next? my thinking was
![6 Things You Didn't Know About the forEach Loop in JavaScript | by fatfish | JavaScript in Plain English 6 Things You Didn't Know About the forEach Loop in JavaScript | by fatfish | JavaScript in Plain English](https://miro.medium.com/v2/resize:fit:1400/0*B2qVHm49yb7Zlj47.png)
6 Things You Didn't Know About the forEach Loop in JavaScript | by fatfish | JavaScript in Plain English
![How async/await runs inside forEach, and why it probably doesn't do what you expect : r/learnjavascript How async/await runs inside forEach, and why it probably doesn't do what you expect : r/learnjavascript](https://external-preview.redd.it/ov3ewQhF_v6QoVNAOf2xPZS2YitEKWCOxzSheeE1UQ4.png?format=pjpg&auto=webp&s=84c3b0d020de60ac9aaecfe979147561fff58a78)