average
average(
x):number
Defined in: src/mean.js:17
The mean, also known as average, is the sum of all values over the number of values. This is a measure of central tendency: a method of finding a typical or central value of a set of numbers.
This runs in O(n), linear time, with respect to the length of the array.
Parameters
Section titled “Parameters”number[]
sample of one or more data points
Returns
Section titled “Returns”number
mean
Throws
Section titled “Throws”if the length of x is less than one
Example
Section titled “Example”mean([0, 10]); // => 5