1
NaN==NaN

returns false in javascripts. i want to know some clear explanation.

typeof NaN is number

Number == Number is return true

Then why NaN==NaN is false. Thanks advance.

  • What do you mean by "*Number == Number is return true*"? – Bergi Dec 15 '18 at 13:50
  • 1
    read here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN – Code Maniac Dec 15 '18 at 13:51
  • 1
    `Number` == `Number`, you are comparing the Number object. Ofcourse it's going to return `true`. It's similar to something like `Math == Math` and so on.. also, `typeof number` returns you the data type of the `NaN`, that is not the same as the Object `Number` – Mr. Alien Dec 15 '18 at 13:56

0 Answers0