Combine the values of an array up to a certain index.
The index to accumulate to, everything after this index will not be accumulated.
An array of values to accumulate.
Combine the values of an array up to a certain index.