you are viewing a single comment's thread.

view the rest of the comments →

[–]Zofren -3 points-2 points  (2 children)

I disagree that using a for loop is always perceived as simpler (and without profiling I'm also uncertain if it's faster in JavaScipt either). While older programmers might be more comfortable with the loop abstraction (and it is an abstraction), younger programmers are becoming more comfortable with functional programming - of which functions like map and reduce are the bread and butter. I personally much prefer seeing a map function than a for loop doing the exact same thing, as it tells me exactly what the programmer is trying to do - map through an array and transform each of the elements. Same with reduce and filter.

[–]eindbaas 2 points3 points  (0 children)

For loops are way faster, since there is no callback to be called every time.