🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@stdlib/assert-is-number

Package Overview
Dependencies
Maintainers
4
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stdlib/assert-is-number

Test if a value is a number.

0.2.2
latest
Source
npm
Version published
Weekly downloads
458K
0.24%
Maintainers
4
Weekly downloads
 
Created

What is @stdlib/assert-is-number?

@stdlib/assert-is-number is a utility package that provides functions to check if a value is a number. It includes checks for different types of numbers such as finite numbers, integers, and NaN values.

What are @stdlib/assert-is-number's main functionalities?

isNumber

The `isNumber` function checks if a value is a number. It returns `true` if the value is a number and `false` otherwise.

const isNumber = require('@stdlib/assert-is-number');
console.log(isNumber(5)); // true
console.log(isNumber('5')); // false

isFinite

The `isFinite` function checks if a value is a finite number. It returns `true` if the value is finite and `false` otherwise.

const isFinite = require('@stdlib/assert-is-number').isFinite;
console.log(isFinite(5)); // true
console.log(isFinite(Infinity)); // false

isInteger

The `isInteger` function checks if a value is an integer. It returns `true` if the value is an integer and `false` otherwise.

const isInteger = require('@stdlib/assert-is-number').isInteger;
console.log(isInteger(5)); // true
console.log(isInteger(5.5)); // false

isNaN

The `isNaN` function checks if a value is NaN (Not-a-Number). It returns `true` if the value is NaN and `false` otherwise.

const isNaN = require('@stdlib/assert-is-number').isNaN;
console.log(isNaN(NaN)); // true
console.log(isNaN(5)); // false

Other packages similar to @stdlib/assert-is-number

Keywords

stdlib

FAQs

Package last updated on 27 Jul 2024

Did you know?

Socket

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.

Install

Related posts