Skip to main content

isNumber

Checks if a value is a number.

Import

You can import the entire package and access the function:


_10
import * as sdk from "@onflow/sdk"
_10
_10
sdk.isNumber(d)

Or import directly the specific function:


_10
import { isNumber } from "@onflow/sdk"
_10
_10
isNumber(d)

Usage


_10
import { isNumber } from "@onflow/sdk"
_10
_10
console.log(isNumber(42)); // true
_10
console.log(isNumber("42")); // false
_10
console.log(isNumber(3.14)); // true
_10
console.log(isNumber(null)); // false

Parameters

d

  • Type: any
  • Description: The value to check

Returns

boolean


Rate this page