has own propriety javascrip

JavaScript
var x = {
    y: 10
};
console.log(x.hasOwnProperty("y")); //true
console.log(x.hasOwnProperty("z")); //falseif (someVar.hasOwnProperty('someProperty') ) {
 // do something();
} else {
 // do somethingElse();
}
Source

Also in JavaScript: