InterviewHubPRO
Section Overview
Q427

Question 427 of 521

Part 7: Execution Context, Functional JS & V8 Engine (404 - 463)

82%
JavaScript Internals (521 Qs)•Part 7: Execution Context, Functional JS & V8 Engine (404 - 463)

What is the difference between isNaN and Number.isNaN?

  1. isNaN: The global function isNaN converts the argument to a Number and returns true if the resulting value is NaN.
  2. Number.isNaN: This method does not convert the argument. But it returns true when the type is a Number and value is NaN.

Let's see the difference with an example,

javascript
 isNaN(‘hello’);   // true
 Number.isNaN('hello'); // false