average property

  1. @useResult
double get average

The average of all elements in this iterable, or double.nan if empty.

[1, 2, 3].average; // 2.0

Implementation

@useResult double get average => sum / length;