reduce abstract method
T
reduce(
- T identity,
- T accumulator(
- T,
- T
Performs a reduction on the elements of this stream, using the provided identity value and an associative accumulation function, and returns the reduced value.
Example
final sum = GenericStream.of([1, 2, 3, 4, 5])
.reduce(0, (a, b) => a + b);
Implementation
T reduce(T identity, T Function(T, T) accumulator);