Skip to content

mean

Get the mean value from an array of numbers.

Usage

js
import { mean } from '@studiometa/js-toolkit/utils';

mean([5, 0, 10]); // 5
mean([20, 0, 10]); // 10
mean([-10, 0, 10]); // 0

Parameters

  • numbers (number[]): The original values.

Return value

  • number: The mean number.

MIT Licensed