DEV Community

Discussion on: Stop using for loops. Here's why.

Collapse
 
alexgmdev profile image
Alex Martin

Looks like you're getting a lot of heat here. But as a somewhat JS beginner it was nice to see the different array implementations compared to their respective loops.

Thanks for the write up.

Collapse
 
matgott profile image
matgott • Edited

The problem isn't the "different array implementations", title is the problem. Is intentionally bad to attract views, but send a wrong message.

.filter, .map, .sort are usefull tools, but FOR is better in terms of performarce. If you have a lot of data to process, FILTER will not be the best choice.

Nobody should stop using for loops.