JavaScript Czy istnieje klucz
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
"key" in obj // true, regardless of the actual value
var obj = { key: undefined };
obj["key"] !== undefined // false, but the key exists!