Skip to content

maximumEntries

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

Find largest entries.

Alternatives: maximums, maximumEntries.
Similar: maximums, minimums.


function maximumEntries(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.maximumEntries(x, 2);
// → [ [ 4, 5 ], [ 0, 4 ] ]

xarray.maximumEntries(x, 3);
// → [ [ 4, 5 ], [ 0, 4 ], [ 3, 3 ] ]


References

Clone this wiki locally