it's ES5 and we're on node. Just use `array.reduce()`