Skip to content
Subhajit Sahu edited this page Aug 8, 2022 · 16 revisions

Find the average of numbers.

Similar: mean, median, modes, variance, range.


function mean(...xs)
// xs: a list of numbers

const xmath = require('extra-math');


xmath.mean(1, 2);
// → 1.5

xmath.mean(1, 2, 3);
// → 2

xmath.mean(1, 2, 3, 4);
// → 2.5
Clone this wiki locally