Skip to content
Subhajit Sahu edited this page Jul 29, 2022 · 2 revisions

Generate a result-negated version of a function.


function negate(x)
// x: a function
const xfunction = require('extra-function');


var fn = xfunction.negate(isFinite);
fn(Infinity)
// → true
fn(1)
// → false

var fn = xfunction.negate(isNaN);
fn(1);
// → true
fn(NaN);
// → false


References

Clone this wiki locally