best()

Gives the best item in a list based on the return value of the given iterator function.

This function is valid in v2.2.0 to v2.24.3. This function has been downloaded 61 times.

Parameters

{Array|undefined|null} array
Either the array to be iterated over to find the best value or undefined (or null) indicating that this is a partial function call.
{Function} iterator
Function that will receive two values starting with the first two in array or in the array passed when calling the returned partial function. When a true-ish is returned by this function the value in array passed as the first argument will be regarded as the best value, otherwise the value in array passed as the second argument will be regarded as the best value.

Returns

{Function|*}
If array is undefined or null a partial function that is simply awaiting the value of array will be returned. Otherwise the value that was determined to be the best will be returned.