sum function

num sum(
  1. Iterable<num> iterable
)

Returns the sum of the given iterable of numbers.

Implementation

num sum(Iterable<num> iterable) {
  num total = 0;
  for (final value in iterable) {
    total += value;
  }
  return total;
}