javascript check if some object exists code example
Example 1: how to check if object exists in javascript
if (typeof maybeObject != "undefined") {
alert("GOT THERE");
}
Example 2: javascript does object have property
var person = {'first_name': 'bill','age':20};
if ( person.hasOwnProperty('first_name') ) {
//person has a first_name property
}