DEV Community

Discussion on: Which types of loops are most popular in the programming languages you use?

Collapse
 
chryw profile image
Cherry Wang

JavaScript

In production I prefer map, reduce, etc. because I always want to return the same type as input. Sometimes I do use for loop when writing temporary utility scripts, or trying to validate some ideas. It's just because for loop is easy to read even without much context.