Skip to content

mean

Calculate the mean (average) of an array of numbers.

Usage

ts
import { mean } from 'rattail'

mean([1, 2, 3, 4, 5]) // return 3
mean([10, 20, 30]) // return 20

Arguments

ArgTypeDefaults
arrnumber[]

Return

Type
number