For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /reference/predicate/isInteger.md.

isInteger

Checks if a value is an integer.

isInteger(42) // true
isInteger(4.2) // false

Usage

isInteger(value: unknown)

Checks if a value is an integer.

import { isInteger } from 'massaman'
// or:  import { isInteger } from 'massaman/predicate'

isInteger(42) // true
isInteger(4.2) // false

Parameters

valueunknownrequired

the value to test.

Returns

whether value is an integer; a true result narrows it to number.

value is number