max - nodef/extra-lists GitHub Wiki
Find largest value.
function max(x, fc, fm)
// x: lists
// fc: compare function (a, b)
// fm: map function (v, k, x)
const xlists = require('extra-lists');
var x = ['a', 'b', 'c', 'd'], [1, 2, -3, -4](/nodef/extra-lists/wiki/'a',-'b',-'c',-'d'],-[1,-2,--3,--4);
xlists.max(x);
// → 2
xlists.max(x, (a, b) => Math.abs(a) - Math.abs(b));
// → -4
xlists.max(x, null, v => Math.abs(v));
// → -4