JS Built-ins
GlobalFunctionsisFiniteintermediate

isFinite β€” numeric string coerces

πŸ“– Usage Example
isFinite('42')      // β†’ true  (coerced to 42)
isFinite('hello')   // β†’ false (coerced to NaN)

The global isFinite() coerces its argument to a number first β€” prefer Number.isFinite() to avoid coercion.

isFinite Coercion

isFinite('42') coerces '42' to 42 and returns true.

Challenge: Verify the coercion.

πŸ’‘ Hints (1)
  • β€’ The global isFinite coerces its argument to a number first.