js check key object in object code example
Example 1: check object has key javascript
Object.prototype.hasOwnProperty()
Example 2: javascript if object has key
if('key' in object)
Object.prototype.hasOwnProperty()
if('key' in object)