Skip to content

Latest commit

 

History

History

is-nan

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

isNaN

Test if a value is NaN.

Usage

var isnan = require( '@stdlib/utils/is-nan' );

isnan( value )

Tests if a value is NaN.

var bool = isnan( NaN );
// returns true

Notes

  • The function first tests if a value is numeric before testing if a value is NaN. For non-numeric values, the function returns false.

    var bool = isnan( 'NaN' );
    // returns false

Examples

var isnan = require( '@stdlib/utils/is-nan' );

console.log( isnan( NaN ) );
// returns true

console.log( isnan( '5' ) );
// returns false

console.log( isnan( 5 ) );
// returns false