Takes a function f and returns a function g such that if called with the same arguments when f returns a "truthy" value, g returns false and when f returns a "falsy" value g returns true.
f
g
false
true
var isNotNil = complement(isNil); isNil(null); //=> true isNotNil(null); //=> false isNil(7); //=> false isNotNil(7); //=> true
Generated using TypeDoc
Takes a function
fand returns a functiongsuch that if called with the same arguments whenfreturns a "truthy" value,greturnsfalseand whenfreturns a "falsy" valuegreturnstrue.