sum method
Returns the sum of all elements.
Example:
[2, 6, 4, 8].sum(); // 20
Implementation
int sum() {
return sumBy((n) => n);
}
Returns the sum of all elements.
Example:
[2, 6, 4, 8].sum(); // 20
int sum() {
return sumBy((n) => n);
}