4 ms·
I can only say: learn how to use reduce and you never loop twice through a list of items or objects. To me reduce is very easy to reason about and makes it sup
by danfritz 6mo ago
I can only say: learn how to use reduce and you never loop twice through a list of items or objects.
To me reduce is very easy to reason about and makes it super easy to properly filter, combine, extract values without ending with filters on filters on maps and maps
- chuckadams 6mo agoDoing everything in one reduce step sounds to me like the opposite of "easy to reason about". Reduce is a powerful tool that everyone should know, but you don't always want to wield the most powerful tool, especially if you're after intermediate values like the OP is.