Skip to content

isInteger

The isInteger function checks if a value is a finite integer number.

Syntax

typescript
isInteger(value)

Parameters

NameTypeDescription
valuenumberValue to be checked.

Return Value

TypeDescription
booleantrue if the value is a finite integer number, else false.

Examples

typescript
isInteger(10);    // true
isInteger(3.14);  // false
isInteger(NaN);   // false

Notes

  • Throws a TypeError if the value is not a number.
  • Useful for mathematical validations and type control.

References

Released under the MIT License.