sumBy method

num sumBy(
  1. num selector(
    1. T element
    )
)

Returns the sum of values extracted by selector.

Implementation

num sumBy(num Function(T element) selector) {
  num total = 0;
  for (final T element in this) {
    total += selector(element);
  }
  return total;
}