sumOf<R extends num> method
R
sumOf<R extends num>(
- R selector(
- T
Returns the sum of all elements in this collection.
Implementation
R sumOf<R extends num>(R Function(T) selector) {
var sum = R == double ? 0.0 : 0;
for (final element in iter) {
sum += selector(element);
}
return sum as R;
}