The missing existential operator for JavaScript. Returns true unless a variable is
null
orundefined
.
npm install existential
If you want to use in the browser (powered by Browserify):
bower install existential --save
and later link in your HTML:
<script src="bower_components/existential/dist/existential.js"></script>
var exists = require('existential');
console.log(exists(null));
// => false
console.log(exists('hello world'));
// => true
- existential-assign – Check for the existential value of a variable/object. Assign one if the value doesn't exist.
- existential-default – Check for the existential value of a variable and assign a value by default.
- existential-default-deep – Deep version of existential-default.
MIT © Kiko Beats