Skip to content

Conversation

@Da-nie-elT
Copy link
Contributor

@Da-nie-elT Da-nie-elT commented Aug 21, 2025

Cleaner change for the For-In Loop snippets. With an early continue for 1 less indent & does not trigger ESLint no-prototype-builtins

I used Object.hasOwn(${2:object}, ${1:key}) over ${2:object}.hasOwn(${1:key}) because the latter only showed "any" in the hover poup while the former gives the method's documentation from the ObjectConstructor typescript interface.

Closes #262678

@Da-nie-elT
Copy link
Contributor Author

@microsoft-github-policy-service agree

Copy link
Collaborator

@mjbvz mjbvz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks yes seems widely enough supported at this point to switch

@mjbvz mjbvz enabled auto-merge August 21, 2025 22:22
@vs-code-engineering vs-code-engineering bot added this to the August 2025 milestone Aug 21, 2025
@mjbvz mjbvz merged commit f35f9bc into microsoft:main Aug 22, 2025
17 checks passed
@Da-nie-elT Da-nie-elT deleted the update-forin-snippet branch August 22, 2025 06:48
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Oct 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update For-In Loop snippet to use Object.hasOwn()

4 participants