Skip to content

isBigInt

Determine if a value is a BigInt

63 bytes
currently in beta

Usage

Pass in a value and get a boolean telling you if the value is a bigint, using the typeof operator.

import * as
import _
_
from 'radashi'
import _
_
.
function isBigInt(value: unknown): value is bigint

Return true if the give value is a BigInt.

@seehttps://radashi.js.org/reference/typed/isBigInt

@example

_.isBigInt(0n) // => true
_.isBigInt(BigInt(0)) // => true
_.isBigInt(12) // => false
_.isBigInt('0n') // => false

@version12.4.0

isBigInt
(0n) // => true
import _
_
.
function isBigInt(value: unknown): value is bigint

Return true if the give value is a BigInt.

@seehttps://radashi.js.org/reference/typed/isBigInt

@example

_.isBigInt(0n) // => true
_.isBigInt(BigInt(0)) // => true
_.isBigInt(12) // => false
_.isBigInt('0n') // => false

@version12.4.0

isBigInt
(
var BigInt: BigIntConstructor
(value: bigint | boolean | number | string) => bigint
BigInt
(0)) // => true
import _
_
.
function isBigInt(value: unknown): value is bigint

Return true if the give value is a BigInt.

@seehttps://radashi.js.org/reference/typed/isBigInt

@example

_.isBigInt(0n) // => true
_.isBigInt(BigInt(0)) // => true
_.isBigInt(12) // => false
_.isBigInt('0n') // => false

@version12.4.0

isBigInt
(12) // => false
import _
_
.
function isBigInt(value: unknown): value is bigint

Return true if the give value is a BigInt.

@seehttps://radashi.js.org/reference/typed/isBigInt

@example

_.isBigInt(0n) // => true
_.isBigInt(BigInt(0)) // => true
_.isBigInt(12) // => false
_.isBigInt('0n') // => false

@version12.4.0

isBigInt
('0n') // => false