maxEntry - nodef/extra-iterable GitHub Wiki
Find largest entry.
function maxEntry(x, fc, fm)
// x: an iterable
// fc: compare function (a, b)
// fm: map function (v, i, x)
const xiterable = require('extra-iterable');
var x = [1, 2, -3, -4];
xiterable.maxEntry(x);
// → [1, 2]
xiterable.maxEntry(x, (a, b) => Math.abs(a) - Math.abs(b));
// → [3, -4]
xiterable.maxEntry(x, null, v => Math.abs(v));
// → [3, -4]