Skip to content

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

@whxvd

Description

@whxvd

MDN URL

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_objects

What specific section or headline is this issue about?

Using object initializers

What information was incorrect, unhelpful, or incomplete?

The text contains:

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

That is not correct in at least two ways:

  1. In the example preceding the text, not every property name is an identifier, only one is.
  2. An identifier is not either a name, a number, or a string literal. In this context, the literals are a certain subset of the strings, and those can be written without "" in this context.

What did you expect to see?

"literal" instead of "identifier" probably would work.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details

Metadata

Metadata

Assignees

No one assigned

    Labels

    Content:JSJavaScript docsgood first issueA good issue for newcomers to get started with.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions