sum property
num
sum
Calculates the sum of all elements in the list. Returns the sum as a number. Example usage:
[1, 2, 3].sum => 6
Implementation
num get sum => isEmpty ? 0 : reduce((value, element) => value + element);