Const
Type guard that checks if a value is an integer.
Returns true if the value is any integer (positive, negative, or zero), with no fractional component. This includes values outside the safe integer range, unlike SafeInt.
true
true if the value is an integer, false otherwise
false
assert.ok(isInt(5));assert.notOk(isInt(5.25));assert.ok(Int.is(-10)); Copy
assert.ok(isInt(5));assert.notOk(isInt(5.25));assert.ok(Int.is(-10));
Type guard that checks if a value is an integer.
Returns
true
if the value is any integer (positive, negative, or zero), with no fractional component. This includes values outside the safe integer range, unlike SafeInt.