Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • As per my view, it will work everytime. Commented May 9, 2013 at 2:53
  • if you're specifically checking for undefined, that should be fine. by undefined, if you include an empty string, 0, null, etc. then that won't catch those. Commented May 9, 2013 at 2:53
  • Just to nit-pick, objects don't have a value, they have properties. What you mean is that you have a variable that may reference an object, or it might be undefined. Commented May 9, 2013 at 3:07