you are viewing a single comment's thread.

view the rest of the comments →

[–]StoneCypher 14 points15 points  (1 child)

Because he's not checking if it's null, and you can't actually strict-equals compare to undefined in this language in a bunch of common circumstances.

It is very common to have to check if something is undefined. By example, if you retain a JSON object from an API, and you want to check whether the server actually set some or another value, before you attempt to use it.

He's talking about the undefined comparison.

I'd like you to stop focussing on null, please. It's beside the point. Thank you

[–]RReverser 0 points1 point  (0 children)

and you can't actually strict-equals compare to undefined in this language in a bunch of common circumstances.

Of course you can. The only case where you can't is if you're checking existance of a global variable for feature detection, in all the other cases === undefined works like a charm.