I'm just so confused right now. If NaN = NaN and sqrt(-1) = NaN, why doesn't sqrt(-1) = sqrt(-1)?
can reproduce. its wierd.
It because the this NaN is different from this Nan is different from this NaN . The first two are not actually text: , , while the last one is: . In the first cases, NaN stands for "Not a Number", meaning that the result is undefined and not even a number. However, they are not considered equal by snap as they could represent different "not a numbers".
*That's the official website, but other sources (e.g. GeeksforGeeks) probably explain it better.