2.2.30 • Published 5 years ago
@extra-iterable/max-index-on.min v2.2.30
Finds index of largest value. :running: :package: :ledger:
Alternatives: compare, map. This is part of package extra-iterable.
This is browserified, minified version of @extra-iterable/max-index-on. It is exported as global variable iterable_maxIndexOn. CDN: unpkg, jsDelivr.
iterable.maxIndexOn(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.maxIndexOn(x);
// 1 ^
iterable.maxIndexOn(x, v => Math.abs(v));
// 3 ^