JavaScript existe la clave
var person={"name":"Billy","age":20}
person.hasOwnProperty("name"); // true
person.hasOwnProperty("sex"); // false
Grepper
var person={"name":"Billy","age":20}
person.hasOwnProperty("name"); // true
person.hasOwnProperty("sex"); // false
if (obj.hasOwnProperty("key1")) {
...
}
var obj = { key: undefined };
obj["key"] !== undefined // false, but the key exists!