A function that reduces or accumulates values of type N by applying a custom logic and returning the accumulated result.
The type of the values being processed in the reduction.
The type of the keys used during the reduction (default: string).
The type of the accumulated result.
The value being processed in the reduction.
The key associated with the value being processed in the reduction.
The index of the current value in the reduction (optional).
The current accumulated result.
A function that reduces or accumulates values of type N by applying a custom logic and returning the accumulated result.