https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce
arr.reduce(callback( accumulator, currentValue, [, index[, array]] )[, initialValue])
The index and array syntax confuses me. It looks like they are both optional, but is it required that you use index if you want to use array? Why is the syntax not laid out like this:
arr.reduce(callback( accumulator, currentValue, [, index], [, array] )[, initialValue])