ts-iterable-functions
    Preparing search index...

    Function sumConst

    • Calculates the arithmetic sum of all numbers in the source iterable.

      Curried version of _sum.

      Returns (src: Iterable) => number

      Total of all elements in src, or 0 when the iterable is empty.

      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