DEV Community

Discussion on: Don’t use for loop for JavaScript Arrays

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀 • Edited

How are you going to use iterators then. Do use for loops, do use array functional methods too.

Collapse
 
sharmakushal profile image
Kushal sharma

It depends upon what is the situation , if i had to just loop over then i will use foreach , else if i had to do asynchorons work inside loop i swith back to the for loop , as for each doesnot support asynchonous

Some comments have been hidden by the post's author - find out more