Skip to content

Commit

Permalink
Remove confusing reference to Object.getOwnPropertyNames() (#31715)
Browse files Browse the repository at this point in the history
* Update index.md to remove " (as with Object.getOwnPropertyNames())"

Previous text: "...does not imply that hasOwnProperty itself is confined strictly to enumerable items (as with Object.getOwnPropertyNames())."

This seems to imply that Object.getOwnPropertyNames is limited to enumerable items.

* Update index.md to clarify reference to `Object.getOwnPropertyNames` as a non-enumerable iterator

* Update files/en-us/web/javascript/reference/global_objects/object/hasownproperty/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
apopheny and github-actions[bot] authored Jan 15, 2024
1 parent 67538b9 commit 619eb04
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ for (const name in buz) {
Note that the {{jsxref("Statements/for...in", "for...in")}} loop
only iterates enumerable items: the absence of non-enumerable properties emitted
from the loop does not imply that `hasOwnProperty` itself is confined strictly
to enumerable items (as with
{{jsxref("Object.getOwnPropertyNames()")}}).
to enumerable items. You can iterate over non-enumerable properties with
{{jsxref("Object.getOwnPropertyNames()")}}.

### Using hasOwnProperty as a property name

Expand Down

0 comments on commit 619eb04

Please sign in to comment.