fold()
Call the reducer for every element of an array.
Description
The fold()
method calls reducer for every element of the array.
The source array isn’t changed.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
seed |
Yes |
Initial state value provided to the reducer Function. |
|
reducer |
Yes |
Return value
Type | Description |
---|---|
Result of the last reducer invocation. The seed is returned for an empty array. |
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!