Finds index of smallest value.
npm install @extra-array/min-index.minFinds index of smallest value. [:running:] [:vhs:] [:package:] [:moon:] [:ledger:]
> Alternatives: [min], [minIndex].
> Similar: [min], [max], [range].
> This is part of package [extra-array].
[extra-array]: https://www.npmjs.com/package/extra-array
> This is browserified, minified version of [@extra-array/min-index].
> It is exported as global variable array_minIndex.
> CDN: [unpkg], [jsDelivr].
[@extra-array/min-index]: https://www.npmjs.com/package/@extra-array/min-index
[unpkg]: https://unpkg.com/@extra-array/min-index.min
[jsDelivr]: https://cdn.jsdelivr.net/npm/@extra-array/min-index.min
``javascript`
array.minIndex(x, [fc], [fm]);
// x: an array
// fc: compare function (a, b)
// fm: map function (v, i, x)
`javascript
const array = require('extra-array');
var x = [1, 2, -3, -4];
array.minIndex(x);
// 3 ^
array.minIndex(x, (a, b) => Math.abs(a) - Math.abs(b));
// 0 ^
array.minIndex(x, null, v => Math.abs(v));
// 0 ^
``
[range]: https://github.com/nodef/extra-array/wiki/range
[:running:]: https://npm.runkit.com/@extra-array/min-index
[:package:]: https://www.npmjs.com/package/@extra-array/min-index
[:moon:]: https://www.npmjs.com/package/@extra-array/min-index.min
[:ledger:]: https://unpkg.com/@extra-array/min-index/
[min]: https://github.com/nodef/extra-array/wiki/min
[minIndex]: https://github.com/nodef/extra-array/wiki/minIndex
[max]: https://github.com/nodef/extra-array/wiki/max
[:vhs:]: https://asciinema.org/a/332101