javasscript check if property exists code example
Example 1: javascript does object have property
var person = {'first_name': 'bill','age':20};
if ( person.hasOwnProperty('first_name') ) {
//person has a first_name property
}
Example 2: check if js property exists in class
myObj.hasOwnProperty(myProp)