Const
Type guard that checks if a value is a safe integer.
Returns true for a safe integer — a value with no fractional component.
true
true if the value is a safe integer, false otherwise
false
assert.isTrue(isSafeInt(Number.MAX_SAFE_INTEGER));assert.isFalse(isSafeInt(Number.MAX_SAFE_INTEGER + 0.5));assert.isTrue(SafeInt.is(Number.MIN_SAFE_INTEGER)); Copy
assert.isTrue(isSafeInt(Number.MAX_SAFE_INTEGER));assert.isFalse(isSafeInt(Number.MAX_SAFE_INTEGER + 0.5));assert.isTrue(SafeInt.is(Number.MIN_SAFE_INTEGER));
Type guard that checks if a value is a safe integer.
Returns
truefor a safe integer — a value with no fractional component.