Scan is similar to
reduce, but returns a list of successively
reduced values from the left
The iterator function. Receives two values, the accumulator and the current element from the array
The accumulator value.
The list to iterate over.
A list of all intermediately reduced values.