Is NaN falsy? Why NaN === false returns false

  1. Falsy and being strictly equal to false are very different things, that’s why one has a y instead of an e. 😉
  2. NaN is spec’d to never be equal to anything. The second part of your question is comparing false === false, which is funnily enough, true 🙂

If you really want to know if something is NaN, you can use Object.is(). Running Object.is(NaN, NaN) returns true.

Leave a Comment