ts-iterable-functions
    Preparing search index...

    Function averageConst

    • Computes the arithmetic mean of a numeric iterable, throwing if the sequence is empty.

      Curried version of _average.

      Returns (src: Iterable) => number

      The arithmetic mean of the input values.

      Error when the iterable produces no elements.

      const mean = _average([2, 4, 6]);
      console.log(mean); // 4

      or using the curried version:

      const mean = pipeInto([2, 4, 6], average());
      console.log(mean); // 4