Loading
Collapses an entire array into a single value by running a function that accumulates as it goes.
Calls the callback with (accumulator, currentElement) for each item. The return value becomes the next accumulator. The second argument to reduce is the initial accumulator. Without it, the first element is used — which can be surprising on empty arrays.
A catamorphism (fold) over a list. Universal: any operation expressible with a loop over an array can be expressed as a reduce. In practice, readability often favors a combination of map + filter over a single complex reduce.