JavaScript中的值(不等值)是什么意思?

mic*_*ech 4 javascript

我在这个 MDN文档中显示的polyfill中看到了这些片段:

 // Casts the value of the variable to a number.
 // So far I understand it ...
 count = +count;
 // ... and here my understanding ends.
 if (count != count) {
   count = 0;
 }
Run Code Online (Sandbox Code Playgroud)

我不明白目的.

怎么可能自己不平等?

小智 5

在JavaScript中,NaN是唯一不等于自身的值.这是对NaN的检查.