I’m pointing this out because on MDN’s website when I search for Object.prototype.hasOwnProperty(), there is a banner with the following:
Note:
Object.hasOwn()is recommended overhasOwnProperty(), in browsers where it is supported.
The main reason is the following on the Object.hasOwn() page
It is recommended over
Object.prototype.hasOwnProperty()because it works for null-prototype objects and with objects that have overridden the inheritedhasOwnProperty()method. While it is possible to workaround these problems by accessingObject.prototype.hasOwnProperty()on another object (likeObject.prototype.hasOwnProperty.call(obj, prop),Object.hasOwn()is more intuitive and concise
So, based on the provided information, I’m asking for a modification in the JavaScript Certification to add the Object.hasOwn() in the How to Check If an Object Has a Property? section of the Introduction to JavaScript Objects and Their Properties and the Checking if an Object has a Property of the JavaScript Review section.
Thank you