Find the item in an array with the highest computed value.
npm install find-with
const findWith = require("find-with")
findWith(["a", "abc", "ab"], item => item.length)
//=> "abc"
findWith.multiple(["a", "abc", "abc", "ab"], item => item.length)
//=> ["abc", "abc"]
Find the item in an array with the highest computed value.
Find the items in an array with the highest computed values.
Type: array
The array to find the items from.
Type: (item, index, array) => number
A predicate that is provided with each item in the array.
The item in the array.
The index of the item in the array.
The array.