objecthasOwnPropertypropertyName
Object.hasOwn is a static method on the Object constructor in JavaScript. It is used to determine whether an object has a specified property as its own direct property, as opposed to inheriting it from its prototype chain. This method was introduced in ECMAScript 2022.
The syntax for Object.hasOwn is Object.hasOwn(obj, prop). The obj argument is the object to inspect, and the
This method is a more robust and safer alternative to Object.prototype.hasOwnProperty. While Object.prototype.hasOwnProperty can be tricked
For example, consider an object created with Object.create(null). If you try to use hasOwnProperty on it, it