npm.io
1.0.18 • Published 7 years ago

if-defined

Licence
MIT
Version
1.0.18
Deps
0
Size
2 kB
Vulns
0
Weekly
0

if-defined

const defined = require('if-defined')

var x

if (!defined(x)) {
    console.log('foobar')
}

Test value to see if it is defined. Return true or false.

The evaluation of defined is done as:

x !== undefined