1 contributor
Like
Install ascend as a package?
Copied
npm i @bit/justin-capalbo.ramda.ascend
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example modifieddraft
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
and packages in Bit or NPM to the example. any of the 1 million componentstoggle layout
No preview available
chevron_left
chevron_right
ascend (
fn:
Function
,a:
*
,b:
) : *
Number
Makes an ascending comparator function out of a function that returns a value
that can be compared with <
and >
.
Example
Arguments
fn:
Function
A function of arity one that returns a value that can be compared
a:
*
The first item to be compared.
b:
*
The second item to be compared.
Returns
Number
`-1` if fn(a) < fn(b), `1` if fn(b) < fn(a), otherwise `0`