Reduces an iterable to a single value by applying the provided reducer
function against an accumulator and each element yielded by the iterable (in
the order in which they are received).
The first invocation of the reducer will receive the first value yielded by
the underlying iterable as its accumulator and the second value yielded as
its currentValue argument.
Reduces an iterable to a single value by applying the provided reducer
function against an accumulator and each element yielded by the iterable (in
the order in which they are received).
Type Parameters
Type Parameters
T
R
Parameters
reducer: ((accumulator: R, currentValue: T) => R)
(accumulator: R, currentValue: T): R
Parameters
accumulator: R
currentValue: T
Returns R
initialValue: R
The value to use as the accumulator on the first
invocation of the reducer function.
Reduces an iterable to a single value by applying the provided
reducer
function against an accumulator and each element yielded by the iterable (in the order in which they are received).The first invocation of the reducer will receive the first value yielded by the underlying iterable as its accumulator and the second value yielded as its currentValue argument.