-
Notifications
You must be signed in to change notification settings - Fork 0
negate
Subhajit Sahu edited this page Aug 7, 2022
·
1 revision
Generate a result-negated version of a function.
function negate(x)
// x: a function
const xasyncfn = require('extra-async-function');
var fn = xasyncfn.negate(isFinite);
await fn(Infinity)
// → true
await fn(1)
// → false
var fn = xasyncfn.negate(isNaN);
await fn(1);
// → true
await fn(Promise.resolve(NaN));
// → false