Post

Reduce should never be used with a non-primitive accumulator imo. We have more semantic alternatives like: • Object.fromEntries() + entries​.map() • Object.groupBy() / Map.groupBy() Even for primitives we’ll have Math.sumPrecise() soon ⏳ github.com/tc39/proposa...

github.comGitHub - tc39/proposal-math-sum: TC39 proposal to add a summation method to JavaScriptTC39 proposal to add a summation method to JavaScript - tc39/proposal-math-sum
Wes Bos@wesbos.com

I love Array.reduce, but I find myself writing less of them as the browser primitives get better. Map + Object groupBy is one place you can now get rid of reduce for www.youtube.com/watch?v=1bfK...

0 reposts10 likes

Habits can be unfortunately hard to break sometimes (and the realities of some corporate jobs mean we're locked out of new features for far too long). Still, after having had to hack around with floats in JS in the past I appreciate this proposal immensely.