sum method
Returns the sum of all elements in the collection.
Implementation
int sum() {
int sum = 0;
for (final element in iter) {
sum += element;
}
return sum;
}
Returns the sum of all elements in the collection.
int sum() {
int sum = 0;
for (final element in iter) {
sum += element;
}
return sum;
}