Reduces values of an iterable (Array, Set, Iterable, AsyncIterable) into a single value using the provided reducer function.
Works with:
Array, Set, custom Iterable)AsyncIterable / async generators)If the initial value isn't provided, the first emitted value is used as the accumulator (same semantics as Array.prototype.reduce).
When used with an empty iterable without an initial value an error is thrown.
Reduces values of an iterable (Array, Set, Iterable, AsyncIterable) into a single value using the provided reducer function.
Works with:
Array,Set, customIterable)AsyncIterable/ async generators)If the initial value isn't provided, the first emitted value is used as the accumulator (same semantics as
Array.prototype.reduce). When used with an empty iterable without an initial value an error is thrown.