How can I check for “undefined” in JavaScript? [duplicate]
If you are interested in finding out whether a variable has been declared regardless of its value, then using the in operator is the safest way to go. Consider this example: But this may not be the intended result for some cases, since the variable or property was declared but just not initialized. Use the in operator for a … Read more