Find largest entry.
Similar: min, max, range.
function maxEntry(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]]; xlists.maxEntry(x); // → [ 'b', 2 ] xlists.maxEntry(x, (a, b) => Math.abs(a) - Math.abs(b)); // → [ 'd', -4 ] xlists.maxEntry(x, null, v => Math.abs(v)); // → [ 'd', -4 ]
There was an error while loading. Please reload this page.