Hacker News new | ask | show | jobs
by danfritz 665 days ago
Clearly the real good refactor was using reduce instead of filter / map.

No need to loop twice over the array. Always use reduce if there are chained methods going through arrays