content icon indicating copy to clipboard operation
content copied to clipboard

Update index.md

Open blmatthews opened this issue 6 months ago • 1 comments

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?

blmatthews avatar Jun 12 '25 17:06 blmatthews

Preview URLs

(comment last updated: 2025-06-17 06:08:00)

github-actions[bot] avatar Jun 12 '25 21:06 github-actions[bot]