sumBy method

num sumBy(
  1. num f(
    1. T
    )
)

Returns the sum of f applied to each element.

Implementation

num sumBy(num Function(T) f) => fold<num>(0, (acc, e) => acc + f(e));