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

Find the value separating the higher and lower halves of numbers.

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


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

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


xmath.median(1, 7);
// → 4

xmath.median(1, 7, 8);
// → 7

xmath.median(1, 7, 8, 10);
// → 7.5


References

Clone this wiki locally