[1, 2, 3].indexOf(3) => 2 [1, 2, NaN].indexOf(NaN) => -1 [1, NaN, 3].indexOf(NaN) => -1
NaN is defined not to be equal to anything (not even itself). See here: http://www.w3schools.com/jsref/jsref_isNaN.asp