foldRight<B> method
- B initialValue,
- B f(
- T element,
- B accumulator
Fold a List into a single value by aggregating each element of the list from the last to the first.
Implementation
B foldRight<B>(B initialValue, B Function(T element, B accumulator) f) =>
toList().reversed.fold(initialValue, (a, e) => f(e, a));