Skip to content
Subhajit Sahu edited this page Dec 28, 2022 · 14 revisions

Find largest value.

Similar: min, max, range.


function max(x, fc, fm)
// x:  ilists
// fc: compare function (a, b)
// fm: map function (v, k, x)
const xilists = require('extra-ilists');

var x = [['a', 'b', 'c', 'd'], [1, 2, -3, -4]];
xilists.max(x);
// → 2

xilists.max(x, (a, b) => Math.abs(a) - Math.abs(b));
// → -4

xilists.max(x, null, v => Math.abs(v));
// → -4


References

Clone this wiki locally