30 seconds of code

  Back to Home

negate

functionbeginner

Negates a predicate function.

Take a predicate function and apply the not operator (!) to it with its arguments.

const negate = func => (...args) => !func(...args);