Specifies a function similar to Array.prototype.reduce() to apply to each word within the slice.
|$reducer||The reducing function.|
|$seed||The initial reduction passed to the reducing function.|
Your custom reducer function should have the following signature:
function (prev, current, index, state)
Where the parameters have the following contents:
- The value returned by the previous call, or the seed value on the first call.
- The current word.
- The number of the current word.
- A state object with a boolean-valued
isLast> property that indicated the last call. You can set it to true to prematurely halt the reduction.
The return from the last call becomes the final reduced result.
You cannot use this method in conjunction with