hasOwnPropertybeginner// Check for own (non-inherited) property
const obj = { a: 1 }
obj.hasOwnProperty('a') // β true
obj.hasOwnProperty('toString') // β falseUse hasOwnProperty() to check whether a property exists directly on an object rather than on its prototype chain.
obj.hasOwnProperty(key) returns true if the object has the specified key as its own (not inherited) property.
Challenge: Implement isOwnProperty(obj, key) that returns whether the key is an own property of the object.