Formal Documentation
The reduce() method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element.
Parameters
- Callback: Function to run for each element.
- Accumulator: The value resulting from the previous call.
- Initial Value: Value to use as the first argument to the first call of the callback.