Calculates the average of a property of each element.
double averageBy(num Function(T) selector) { if (isEmpty) return 0; return sumBy(selector) / length; }