Skip to content
Subhajit Sahu edited this page Aug 9, 2022 · 2 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 xnumber = require('extra-number');


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

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

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


References

Clone this wiki locally