- reduce<T, U>(accumulator: ((acc: T, next: U) => T), initial: T): ((arr: readonly U[]) => T)
-
Parameters
-
accumulator: ((acc: T, next: U) => T)
-
- (acc: T, next: U): T
-
Returns T
-
initial: T
Returns ((arr: readonly U[]) => T)
-
- (arr: readonly U[]): T
-
Returns T
Remarks
The
initial
value is mandatory. This is required soaccumulator
can accept different types foracc
andnext
.Example