3 ms·
I mean to me the whole point of NaN is that it should not equal NaN, so it seems sort of like you are making the complaint in the first sentence in your second
by bryanrasmussen 1mo ago
I mean to me the whole point of NaN is that it should not equal NaN, so it seems sort of like you are making the complaint in the first sentence in your second sentence, only in a slightly more abstracted way. Unless you are of the opinion there is another better point to NaN?
funny story, I was once interviewing for a job where the tech guy did not know that NaN existed. I guess JavaScript wasn't his language, but not sure what was, and the code was in JavaScript for a Web Dev role.
- afiori 1mo agomy point is that that a lot of people shit on js for having "weird crazy stuff in it" and then the example is 0.1 + 0.1 + 0.1 !== 0.3 or NaN != NaN which has nothing to do with js semantics JS is weird, and not having a stronger separation between ints and floats makes NaNs more common than in other languages (eg parseInt would not return NaNs in C or python) but for many "weird" examples people are making fun of normal stuff.