DEV Community

Discussion on: Why is using javascript “for loop” for array iteration a bad idea?

Collapse
 
hasnaindev profile image
Muhammad Hasnain

Higher order functions makes code cleaner and easy to understand. forEach may be simple but filter, map or reduce makes tedious operations very easy to implement.

Collapse
 
_prosen profile image
Prosen Ghosh

Yes, forEach() method also a higher order function.

But as i mention before that, i use those methods depending on the context where it fits the most.