There was an error while loading. Please reload this page.
Find largest value.
Alternatives: max, maxEntry. Similar: min, max, range.
function max(x, fc, fm) // x: a map // fc: compare function (a, b) // fm: map function (v, k, x)
const map = require('extra-map'); var x = new Map([['a', 1], ['b', 2], ['c', -3], ['d', -4]]); map.max(x); // → 2 map.max(x, (a, b) => Math.abs(a) - Math.abs(b)); // → -4 map.max(x, null, v => Math.abs(v)); // → -4