-
Notifications
You must be signed in to change notification settings - Fork 0
negate
Subhajit Sahu edited this page Jul 22, 2022
·
2 revisions
Generate a result-negated version of a function.
function negate(x)
// x: a function
const {negate} = require('extra-function');
var fn = negate(isFinite);
fn(Infinity)
// → true
fn(1)
// → false
var fn = negate(isNaN);
fn(1);
// → true
fn(NaN);
// → false