sum method

num sum()

Returns sum of all elements

Implementation

num sum() {
  num total = 0;
  for (final element in this) {
    total += element;
  }
  return total;
}