首页 > 代码库 > [Ramda] Complement: Logic opposite function

[Ramda] Complement: Logic opposite function

Take a function as arguement, and the function only return true of false.

 

If the function ‘f‘ return ture, when complement(f) will return false.

var isEven = n => n % 2 === 0;var isOdd = R.complement(isEven);isOdd(21); //=> trueisOdd(42); //=> false

 

[Ramda] Complement: Logic opposite function