sum method

double sum()

Returns the sum of all elements.

Example:

[2.0, 6.0, 4.0, 8.0].sum(); // 20.0

Implementation

double sum() => sumByDouble((n) => n);