sumBy<T extends num> method
Null safety
- T selector(
- int index,
- E
Returns the sum of all values produced by selector
function applied to each element in the collection.
For example:
[jon, amy, joe].sumBy((_, student) => student.score) // => total score
Implementation
T sumBy<T extends num>(T Function(int index, E) selector) =>
mapIndexed(selector).sum();