Calculates the arithmetic sum of all numbers in the source iterable.
Source iterable yielding numeric values to accumulate.
Total of all elements in src, or 0 when the iterable is empty.
src
0
const total = _sum([1, 2, 3, 4]);console.log(total); // 10 Copy
const total = _sum([1, 2, 3, 4]);console.log(total); // 10
or using the curried version:
const total = pipeInto([1, 2, 3, 4], sum());console.log(total); // 10 Copy
const total = pipeInto([1, 2, 3, 4], sum());console.log(total); // 10
Calculates the arithmetic sum of all numbers in the source iterable.