1.0.1 • Published 6 years ago
index-of-min v1.0.1
index-of-min
Finds the minimum value or an object with the min property in an array
Example
const indexOfMin = require('index-of-min');
const arrayOfValues = [3, 2, 1];
console.log(indexOfMin(arrayOfValues));
// 2
const arrayOfObjects = [{a: 3}, {a: 2}, {a: 1}];
console.log(indexOfMin(arrayOfObjects, 'a'));
// 2