JavaScript · Junior · Question 66 of 75

How does Number.isNaN("abc") differ from isNaN("abc")?

Explanation

The global isNaN coerces its argument, which leads to surprises. Number.isNaN checks only for the actual NaN value.

Further reading

Problem with a question

JavaScript · Junior · question 66

Test yourself

Take the JavaScript · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz