check if object exists javascript code example
Example 1: how to check if object exists in javascript
if (typeof maybeObject != "undefined") {
alert("GOT THERE");
}
Example 2: check if field exists in object javascript
if ('field' in obj) {
}