Style poll, which do you prefer? Yes they are slightly different, but the edge case of a key pointing to undefined might not matter...
-
-
If I mean to test for either null or undefined, I'll usually do (x === undefined || x === null) explicitly to capture that intent.
-
I use `in` because I want to test if an object has a key. If someone gives me an object with a key pointing to `undefined`, whatever.
- 7 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.