my rule for .reduce(): only use it when the result has the same type as the items and the reducer is associative, like
.reduce((a, b) => a + b, 0)
summing some numbers
multiplying some numbers
building up a list or object
just about anything else (use a loop)
-
-
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 