Returns the complement of a function.
const a = (x: number) => x > 0;const b = complement(a);console.log(a(1)); // trueconsole.log(b(1)); // false Copy
const a = (x: number) => x > 0;const b = complement(a);console.log(a(1)); // trueconsole.log(b(1)); // false
The type of the function.
The function.
A function whose result is the negation of the result of fn.
Rest
Returns the complement of a function.
Example