Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Ah, i hate those coding styles where everything must use forEach/map/reduce


forEach is still a loop


The functional programmers (in my circle) have latched on to forEach/map/reduce/filter etc as the bibile of functional programming. Writing a simple for..each loop will make them reject PRs


Sure, but `forEach` is not even in the same category as map/filter/reduce. `forEach` is in no way functional.


I mean just search for "is forEach functional programming"


forEach is just an alternate syntax for a for..in loop, that instead of being a block it takes a closure. It's not functional, since it's only used for side-effects.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: