javascript - Is there an R.notEquals equivalent in Ramda? -
in ramda can follows (this hypothetical code, designed illustrate kind of solution i'm search for)
const highest = function(attribute) { switch(attribute){ case 'score': return 'john' } } const hashighestscore = r.compose( r.equals, r.tolower, highest )('score') hashighestscore('john') // true
is there equivalent r.equals returns opposite value yet works same r.equals?
such hypothetical code work:
const hasnothighestscore = r.compose( r.notequals, r.tolower, highest )('score')
obviously inverse previous result
const doesnothavehighestscore = x => !hashighestscore(x)
but i'd know if there r.notequals or perhaps can create myself? thanks.
consider following (i wrote before reading comments, honest. don't know why person didn't answer):
const nothashighestscore = r.compose( r.complement, r.equals, r.tolower, highest )('score')
Comments
Post a Comment