In fact, this is written in the comment right above:
// NaN means non-coding
So, first you need to perform this comparison to handle the NaN event, as in JavaScript:
NaN === NaN returns false .
As pointed out by James Wiseman , it is also important to know why the developer used high !== high instead of isNaN(high) , which would be clearer.
This is definitely based on performance. This test shows that a !== a is twenty times faster than isNaN(a) .
zzzzBov also indicates that isNaN() can be overwritten, using !== also more portable.
Further information from Benjamin Gruenbaum :
It is also worth noting that NaN does not correspond to anything else, because well, and also it is not equal to anything else in a non-strict sense
And from Jan Dvořák :
Also note that {valueOf:function(){return{}}} does it yourself
koopajah Feb 08 '13 at 12:12 2013-02-08 12:12
source share