DEV Community

Discussion on: Why do we write JavaScript like this?

Collapse
 
_hhandoko profile image
Herdy Handoko

Missed the reply notification 😬

Not so much of a problem, but rather that for loops carry higher cognitive overload, whereas map or filter is composable and easier to comprehend (e.g. treating it as data pipeline).

So there is definitely a tradeoff, readability vs performance.