Returns the average of f applied to each element. Returns 0 if empty.
f
0
double averageBy(num Function(T) f) => isEmpty ? 0 : sumBy(f) / length;