foldRight<B> method
B
foldRight<B>(
- B initialValue,
- B combine(
- B previousValue,
- T element
Fold this 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(B previousValue, T element) combine,
) {
var value = initialValue;
for (var element in reversed) {
value = combine(value, element);
}
return value;
}