▲ Ditch for loops. Here is a case study to convince you at advancedweb.hu▼2 up and 1 down, posted by sashee 2551 days ago 4 comments
gotofritz 2551 days ago. link 2 points ▲ ▼Surely a better way to get the first n items from an array is with a slice? arr .slice(0, n) .map(..or whatever...)
sashee 2550 days ago. link 1 point ▲ ▼In like 99% of all the cases, it's not. Only every few months I find a problem that is slow and refactoring it to something other than `map` shows a discernible improvement. So it's rare.