Finds largest value. :running: :vhs: :package: :moon: :ledger:
Alternatives: compare, map.
This is part of package extra-iterable.
This is browserified, minified version of @extra-iterable/max-on.
It is exported as global variable iterablemaxOn.
CDN: unpkg, jsDelivr.
iterable.maxOn(x, [fn], [ths]);
// x: an iterable
// fn: map function (v, i, x)
// ths: this argument
const iterable = require('extra-iterable');
var x = [1, 2, -3, -4];
iterable.maxOn(x);
// 2
iterable.maxOn(x, v => Math.abs(v));
// -4