Share your code. Components are building blocks, you are the architect.

utils/max-by
v1.1.0
1.1.0
1.0.0
MIT
PUBLIC
3
1     DEPENDENCIES
Build: fail
BuildFail
Build Status: fail
Takes a function and two values, and returns whichever value produces the

Please configure Bit as a scoped registry to install components with NPM.Learn more

npm config set '@bit:registry' https://node.bitsrc.io
Use utils/max-by in your project
npm i @bit/bit.ramda.utils.max-by
Copied

maxBy (f:Function, a:*, b:*) : *

Takes a function and two values, and returns whichever value produces the larger result when passed to the provided function.

Example

//  square :: Number -> Number
     var square = n => n * n;

     R.maxBy(square, -3, 2); //=> -3

     R.reduce(R.maxBy(square), 0, [3, -5, 4, 1, -2]); //=> -5
     R.reduce(R.maxBy(square), 0, []); //=> 0

Arguments

f: Function

a: *

b: *

Returns

*