Skip to content

@technobuddha > library > Math > Statistics

Function: mean()

ts
function mean(numbers: number[]): number;

Defined in: mean.ts:10

Calculates the Operations mean (average) of an array of numbers.

Parameters

ParameterTypeDescription
numbersnumber[]An array of numbers to calculate the mean of.

Returns

number

The mean of the numbers, or NaN if the array is empty.