Add Object.hasOwn() to the JavaScript Certification

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 over hasOwnProperty(), 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 inherited hasOwnProperty() method. While it is possible to workaround these problems by accessing Object.prototype.hasOwnProperty() on another object (like Object.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

Thank you for helping make FCC better. Bugs can be reported as GitHub Issues. Whenever reporting a bug, please check first that there isn’t already an issue for it and provide as much detail as possible.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.