javascript check if exists in dictionary code example
Example 1: javascript does key exist
var person={"name":"Billy","age":20}
person.hasOwnProperty("name"); // true
person.hasOwnProperty("sex"); // false
Example 2: jquery if key exists in object
Use the in operator:
testArray = 'key1' in obj;
Sidenote: What you got there, is actually no jQuery object, but just a plain JavaScript Object