Skip to content

isInt

Determine if a value is an int

43 bytes

Usage

Pass in a value and get a boolean telling you if the value is an int.

import * as
import _
_
from 'radashi'
import _
_
.
function isInt(value: unknown): value is number
export isInt

Literally just Number.isInteger with a better type.

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

@example

isInt(0) // => true
isInt(0.1) // => false

@version12.1.0

isInt
(12) // => true
import _
_
.
function isInt(value: unknown): value is number
export isInt

Literally just Number.isInteger with a better type.

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

@example

isInt(0) // => true
isInt(0.1) // => false

@version12.1.0

isInt
(12.233) // => false
import _
_
.
function isInt(value: unknown): value is number
export isInt

Literally just Number.isInteger with a better type.

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

@example

isInt(0) // => true
isInt(0.1) // => false

@version12.1.0

isInt
('hello') // => false