fold
array →
fold(
accumulator: accumulator
) → any
Executes an accumulator once over the full input enumerable and returns the final accumulated value. Returns null when the input is not an enumerable or is a string.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
accumulator | accumulator | Yes | Factory that creates the accumulator instance used for the fold execution. |
Examples
{1, 2, 3} | fold(sum) → 6
Kind: Function
Scope: array
Aliases: array-to-fold