4 ms·
As programmers we all know that Javascript has some crazy edge cases. I'm not actually all that impressed by this illustration of Javascript's equality rules.
by chavesn 13y ago
As programmers we all know that Javascript has some crazy edge cases.
I'm not actually all that impressed by this illustration of Javascript's equality rules. This makes it look crazy when in fact it just gives the many edge cases much stronger visual weight.
The truth is, Javascript has lent strongly toward being natural in many of the most common cases -- things like being able to do `args = args || []` or simply prepending `!` to anything. Then, sometimes when you end up comparing NaN to undefined you aren't sure what the result should be or how you ended up there.
Funny thing is that often when I've run into those problems myself, I pull on the thread and find it was really caused by my own poor design somewhere else.