mean
mathComputes the mean of the values in array.
Signature
mean(array: number[]): numberParameters
| Name | Type | Description |
|---|---|---|
array | number[] | The array to iterate over |
Returns
number - Returns the mean
Examples
Basic usage
import { mean } from 'dashlite'
const result = mean([4, 2, 8, 6])
console.log(result)Output:
5Empty array
import { mean } from 'dashlite'
const result = mean([])
console.log(result)Output:
NaNAvailable since version 1.0.0