Sums all numbers of an Iterable.
const result = sum([1,2,3]);console.log(result); // 6
avg and reduce for similar operations.
the sum of all numbers, or undefined if Iterable was empty
undefined
the Iterable to sum
Generated using TypeDoc
Sums all numbers of an Iterable.
Example
See
avg and reduce for similar operations.
Returns
the sum of all numbers, or
undefinedif Iterable was empty