JS Built-ins
NumberisIntegerbeginner

Number.isInteger() β€” '4' (string) is not an integer

πŸ“– Usage Example
// Check if a value is an integer
Number.isInteger(42)    // β†’ true
Number.isInteger(42.5)  // β†’ false
Number.isInteger('42')  // β†’ false

Use Number.isInteger() to verify that a value is a whole number, without type coercion.

Number.isInteger() β€” No Coercion

Unlike some JS checks, Number.isInteger() does not coerce strings.

πŸ’‘ Hints (1)
  • β€’ `Number.isInteger` only accepts actual number types β€” no string coercion.