how to check if a key existin in an object javascript code example
Example 1: javascript hashtable contains key
if (obj.hasOwnProperty("key1")) {
...
}
Example 2: check if a key exists in an object javascript
"key" in obj // true, regardless of the actual value