The callback computes the next state, given the current state and an element of the array. .reduce() feeds it the array elements, starting at index 0, going forward. If no firstState is provided, the array element at index 0 is used, instead. The last state is the result of .reduce().