6.
Which of the following methods can be used to check if a certain property exists in an object in JavaScript?
Object.keys()
Object.values()
Object.hasOwnProperty()
Object.entries()
Correct: C
The Object.hasOwnProperty() method is used to check if a specified property is present in an object. It returns a boolean value indicating whether the object has the specified property as a direct property of that object. This method is useful when you want to check if a property exists without considering properties in the object's prototype chain.