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

Find the values that appear most often.

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


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

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


xmath.modes(1, 2);
// → [1, 2]

xmath.modes(1, 2, 2);
// → [2]

xmath.modes(1, 2, 2, 3, 3);
// → [2, 3]


References

Clone this wiki locally