in reply to Re: cool way of manipulating array elementsin thread cool way of manipulating array elements
I use map, not for its "compact syntax", but depending on the use case. This example, in my opinion, is the perfect use case for map: transform an array using some criteria and return a new array.
for (or, foreach if you like) has its place, but I don't find it inherently more readable than map.
DejaVu Sans Mono
Droid Sans Mono
Envy Code R
Source Code Pro
The default, whatever it is
Results (352 votes). Check out past polls.