Skip to content

Comments

fix: correct terminology for object initializer property names#43182

Merged
Josh-Cena merged 2 commits intomdn:mainfrom
MrLawrenceKwan:fix/object-initializer-property-key-43095
Feb 21, 2026
Merged

fix: correct terminology for object initializer property names#43182
Josh-Cena merged 2 commits intomdn:mainfrom
MrLawrenceKwan:fix/object-initializer-property-key-43095

Conversation

@MrLawrenceKwan
Copy link
Contributor

Replace incorrect use of 'identifier' with 'property key' and clarify that property names in object initializers can be identifier names, number literals, or string literals.

As noted in the issue, the original text incorrectly states that each property name is an 'identifier', but identifiers are only one of the valid property key types. Numbers and string literals are not identifiers.

Fixes #43095

@MrLawrenceKwan MrLawrenceKwan requested a review from a team as a code owner February 21, 2026 05:40
@MrLawrenceKwan MrLawrenceKwan requested review from Josh-Cena and removed request for a team February 21, 2026 05:40
@github-actions github-actions bot added Content:JS JavaScript docs size/xs [PR only] 0-5 LoC changed labels Feb 21, 2026
Copy link
Member

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

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

Very nice, thank you!

@github-actions
Copy link
Contributor

Preview URLs (1 page)

@Josh-Cena Josh-Cena merged commit 59433be into mdn:main Feb 21, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:JS JavaScript docs size/xs [PR only] 0-5 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Each property name before colons is an identifier (either a name, a number, or a string literal)"

2 participants