complement(fn)
Return a function that accept the same arguments as the function fn
, has the same effects,
if any, and returns the opposite truth value.
let is_not_number = complement(is_number)
is_not_number("abc")
// true
is_not_number(123)
// false