JS Built-ins
GlobalFunctionsisNaNintermediate

isNaN β€” numeric string coerces to number

πŸ“– Usage Example
isNaN('42')           // β†’ false (coerced: Number('42') β†’ 42)
Number.isNaN('42')    // β†’ false

The string '42' coerces to 42, which is not NaN, so isNaN returns false.

isNaN with Numeric String

isNaN('42') coerces '42' to 42 and returns false.

Challenge: Verify the coercion.

πŸ’‘ Hints (1)
  • β€’ The string '42' coerces to the number 42, which is not NaN.