Skip to content

minimums

Subhajit Sahu edited this page May 3, 2023 · 1 revision

Find smallest values.

Alternatives: minimums, minimumEntries.
Similar: maximums, minimums.


function minimums(x, n, fc, fm)
// x:  an array
// n:  number of values
// fc: compare function (a, b)
// fm: map function (v, i, x)

const xarray = require('extra-array');

var x = [4, 2, 1, 3, 5];
xarray.minimums(x, 2);
// → [ 1, 2 ]

xarray.minimums(x, 3);
// → [ 1, 2, 3 ]


References

Clone this wiki locally