Computes the arithmetic mean of a numeric iterable, throwing if the sequence is empty.
Source iterable yielding numeric values to average.
The arithmetic mean of the input values.
Error when the iterable produces no elements.
const mean = _average([2, 4, 6]);console.log(mean); // 4 Copy
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 Copy
const mean = pipeInto([2, 4, 6], average());console.log(mean); // 4
Computes the arithmetic mean of a numeric iterable, throwing if the sequence is empty.