javascript does key exist
snippet in javascript

javascript does key exist

user5108

var person={"name":"Billy","age":20}
person.hasOwnProperty("name"); // true
person.hasOwnProperty("sex"); // false

javascript hashtable contains key

user337

if (obj.hasOwnProperty("key1")) {
  ...
}