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
f
and returns a functiong
such that if called with the same arguments whenf
returns a "truthy" value,g
returnsfalse
and whenf
returns a "falsy" valueg
returnstrue
.