Simply the fjs.best item

fjs.best

fjs.best returns the best item in a list based on the return value for the iterator function - it’s essentially a special fjs.reduce. Can be curried by default.

Usage

fjs.best(iterator, items);

Example

var longest = fjs.best(function (arg1, arg2) {
return arg1.length > arg2.length;
});
longest(["simply", "the", "best"]); // => "simply"