4 ms·
Reduce shouldn't be considered in the same category as nullish-coalescing. Reduce is on par with array.map. It's perfect for when you have an iterable and want
by sdegutis 7y ago
Reduce shouldn't be considered in the same category as nullish-coalescing. Reduce is on par with array.map. It's perfect for when you have an iterable and want to reduce it down, pair by pair, to one item. It should be used when that situation comes up, and it shouldn't be used outside of it. This is pretty cut and dried.