time-to-botec/squiggle/node_modules/@stdlib/assert/is-number
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00
..
docs feat: add the node modules 2022-12-03 12:44:49 +00:00
lib feat: add the node modules 2022-12-03 12:44:49 +00:00
package.json feat: add the node modules 2022-12-03 12:44:49 +00:00
README.md feat: add the node modules 2022-12-03 12:44:49 +00:00

isNumber

Test if a value is a number.

Usage

var isNumber = require( '@stdlib/assert/is-number' );

isNumber( value )

Tests if a value is a number.

var Number = require( '@stdlib/number/ctor' );

var bool = isNumber( 3.14 );
// returns true

bool = isNumber( new Number( 3.14 ) );
// returns true

bool = isNumber( NaN );
// returns true

bool = isNumber( null );
// returns false

isNumber.isPrimitive( value )

Tests if a value is a primitive number.

var Number = require( '@stdlib/number/ctor' );

var bool = isNumber.isPrimitive( 3.14 );
// returns true

bool = isNumber.isPrimitive( NaN );
// returns true

bool = isNumber.isPrimitive( new Number( 3.14 ) );
// returns false

isNumber.isObject( value )

Tests if a value is a Number object.

var Number = require( '@stdlib/number/ctor' );

var bool = isNumber.isObject( 3.14 );
// returns false

bool = isNumber.isObject( new Number( 3.14 ) );
// returns true

Examples

var Number = require( '@stdlib/number/ctor' );
var isNumber = require( '@stdlib/assert/is-number' );

var bool = isNumber( 5 );
// returns true

bool = isNumber( new Number( 5 ) );
// returns true

bool = isNumber( NaN );
// returns true

bool = isNumber( '5' );
// returns false

bool = isNumber( null );
// returns false