9 ms·
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 g
by danfritz 2y 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