JS Built-ins
NumberisNaNbeginner

Number.isNaN() β€” NaN returns true

πŸ“– Usage Example
// Check for NaN without coercion
Number.isNaN(NaN)    // β†’ true
Number.isNaN('NaN')  // β†’ false (no coercion)
Number.isNaN(42)     // β†’ false

Use Number.isNaN() instead of the global isNaN() to check for NaN without coercing the argument first.

Number.isNaN()

Number.isNaN(value) returns true only if the value is NaN. It does not coerce non-number types.

πŸ’‘ Hints (1)
  • β€’ `Number.isNaN` is the reliable way to check for `NaN` without coercion.