Calculates the average of all numbers in an array. Array items which aren't a valid number are ignored and do not factor into averaging.
Use minMaxAvg if you want min, max and total as well.
import * as Numbers from 'https://unpkg.com/ixfx/dist/numbers.js';// Average of a listconst avg = Numbers.average([1, 1.4, 0.9, 0.1]);// Average of a variableconst data = [100,200];Numbers.average(data); Copy
import * as Numbers from 'https://unpkg.com/ixfx/dist/numbers.js';// Average of a listconst avg = Numbers.average([1, 1.4, 0.9, 0.1]);// Average of a variableconst data = [100,200];Numbers.average(data);
averageWeighted To weight items based on position in array
Data to average.
Average of array
Calculates the average of all numbers in an array. Array items which aren't a valid number are ignored and do not factor into averaging.
Use minMaxAvg if you want min, max and total as well.
Example
See
averageWeighted To weight items based on position in array