Test if a value is undefined.
var isUndefined = require( '@stdlib/assert/is-undefined' );
Tests if a value
is undefined
.
var bool = isUndefined( undefined );
// returns true
var isUndefined = require( '@stdlib/assert/is-undefined' );
var bool;
var x;
bool = isUndefined( x );
// returns true
bool = isUndefined( undefined );
// returns true
bool = isUndefined( void 0 );
// returns true
bool = isUndefined( 'beep' );
// returns false
bool = isUndefined( 5 );
// returns false
bool = isUndefined( null );
// returns false
bool = isUndefined( true );
// returns false
bool = isUndefined( {} );
// returns false
bool = isUndefined( [] );
// returns false
bool = isUndefined( function foo() {} );
// returns false
@stdlib/assert/is-null
: test if a value is null.@stdlib/assert/is-undefined-or-null
: test if a value is undefined or null.