Parameters
- array: T[]
- iteratee: ((accumulator: S[], value: T, index: number, object: T[]) => boolean)
- (accumulator, value, index, object): boolean
Parameters
- accumulator: S[]
- value: T
- index: number
- object: T[]
Returns boolean
Optionalaccumulator: S[] = []
Returns S[]
Returns the accumulated value.
An alternative to
reducethis method transformsobjectto a newaccumulatorobject which is the result of running each of its own enumerable string keyed properties thruiteratee, with each invocation potentially mutating theaccumulatorobject. Ifaccumulatoris not provided, a new object with the same[[Prototype]]will be used. The iteratee is invoked with four arguments: (accumulator, value, key, object). Iteratee functions may exit iteration early by explicitly returningfalse.