sum method
Returns sum of all elements
Implementation
num sum() {
num total = 0;
for (final element in this) {
total += element;
}
return total;
}
Returns sum of all elements
num sum() {
num total = 0;
for (final element in this) {
total += element;
}
return total;
}