NaN !== NaN (aka JavaScript==='CRAZY')

Working on re-implementing lodash, and discovered this expression in their comparator function:

var valIsReflexive = value === value; 
// um.. WTH is THAT ^^^^^^^^ 

Not understanding why there were two separate "equals" statements (the first as an assignment, and the second as a strict equality operator), I asked my friend Lindsey for help. She explained that the '===' is making a comparison, and the value of the comparison, value === value (true or false), is then stored in the variable, valIsReflexive.

Which then begs the question, when would value === value ever evalute to false?

So back to Stack Overflow I went, and eventally landed here.

And that's where I learned that NaN is, like, totally crazypants. I ran a few tests in my code, to confirm this; results below.

// false
// true

And then, I was like, "WAT." (You should totally watch that, btw. Gary Bernhardt === GOLD.) But then fnenu asked, "What if you set those values to variables, does it still evaluate to false?" This is an excellent question, so I ran another test:

var wat = NaN;
var waat = NaN;
// false
// false   <-- I KNOW, RIGHT?! 

GAH. Mind, bent.