
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
@stdlib/assert-is-nan
Advanced tools
We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.
The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.
When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.
To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!
Test if a value is NaN.
npm install @stdlib/assert-is-nan
var isnan = require( '@stdlib/assert-is-nan' );
Tests if a value is NaN.
var Number = require( '@stdlib/number-ctor' );
var bool = isnan( NaN );
// returns true
bool = isnan( new Number( NaN ) );
// returns true
bool = isnan( 3.14 );
// returns false
bool = isnan( null );
// returns false
Tests if a value is a NaN primitive number.
var Number = require( '@stdlib/number-ctor' );
var bool = isnan.isPrimitive( NaN );
// returns true
bool = isnan.isPrimitive( 3.14 );
// returns false
bool = isnan.isPrimitive( new Number( NaN ) );
// returns false
Tests if a value is a Number object having a value of NaN.
var Number = require( '@stdlib/number-ctor' );
var bool = isnan.isObject( NaN );
// returns false
bool = isnan.isObject( new Number( NaN ) );
// returns true
var Number = require( '@stdlib/number-ctor' );
var Symbol = require( '@stdlib/symbol-ctor' );
var isnan = require( '@stdlib/assert-is-nan' );
var bool = isnan( NaN );
// returns true
bool = isnan( new Number( NaN ) );
// returns true
bool = isnan( 5 );
// returns false
bool = isnan( '5' );
// returns false
bool = isnan( null );
// returns false
bool = isnan( Symbol( 'NaN' ) );
// returns false
@stdlib/assert-is-number: test if a value is a number.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.
See LICENSE.
Copyright © 2016-2026. The Stdlib Authors.
FAQs
Test if a value is NaN.
The npm package @stdlib/assert-is-nan receives a total of 67,164 weekly downloads. As such, @stdlib/assert-is-nan popularity was classified as popular.
We found that @stdlib/assert-is-nan demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.