@stdlib/assert-is-undefined

Test if a value is undefined.

Usage no npm install needed!

<script type="module">
  import stdlibAssertIsUndefined from 'https://cdn.skypack.dev/@stdlib/assert-is-undefined';
</script>

README

isUndefined

NPM version Build Status Coverage Status

Test if a value is undefined.

Installation

npm install @stdlib/assert-is-undefined

Usage

var isUndefined = require( '@stdlib/assert-is-undefined' );

isUndefined( value )

Tests if a value is undefined.

var bool = isUndefined( undefined );
// returns true

Examples

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

Notice

This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.

Community

Chat


License

See LICENSE.

Copyright

Copyright © 2016-2022. The Stdlib Authors.