if-not
v1.0.5
Published
a package that helps you to check if a condition is false without excessive use of !
Downloads
6
Maintainers
Readme
if-not
a package that helps you to check if a condition is false without excessive use of !
installation:
npm install if-not
example with and without if-not:
// with if-not:
import ifnot from "if-not";
ifnot(false, console.log, "Hello world!", "second argument!");
ifnot(true, console.log, "this won't be executed!");
// without if-not: look at all the bangs! all the indentation! this is unacceptable!
if(!false) {
console.log("Hello world!", "second argument!");
}
if(!true) {
console.log("this won't be executed");
}
output for both:
$ node .
Hello world! second argument!