Update index.md
In the "Problematic cases for hasOwnProperty" section, show how hasOwnProperty operates in the two cases as well as Object.hasOwn, and correct the expected output of the Object.hasOwn examples (it was logging the property value, which wouldn't result in true or false. Modified it to just log the Object.hasOwn result).
Description
Make clearer how hasOwnProperty works in the two cases and make it easy to compare with Object.hasOwn. Also correct the expected output of the console.logs in the Object.hasOwn cases.
Motivation
Makes the difference between Object.hasOwn and hasOwnProperty clearer by having them in the same example, and fix the expected output in the Object.hasOwn cases.
Additional details
Related issues and pull requests
I was going to create an issue but it directed me to do this, so I did. Should I still create an issue, or is this sufficient?
Preview URLs
(comment last updated: 2025-06-17 06:08:00)