Skip to content

Dot and bracket path segments are interchangeable everywhere

The rule

Normative: this is the rule
  1. A property path written with dot segments, bracket segments, or a mixture of the two MUST be accepted.
  2. An implementation normalizes them to a single form before parsing.
  3. Every place an implementation reads a property path MUST resolve the two spellings identically.

What it means

Dot and bracket segments are not two dialects an implementation merely tolerates side by side — they are normalized to one form before anything is parsed, so no code path can see the difference. A dot segment reaching into an array by numeral, users.0.name, is not a special case handled separately from store.name: it normalizes the same way, and the same value comes back whichever spelling reached it.

Example

The same value in the evaluation context, reached once as store.name and once as [store][name]:

What both the dot form and the bracket form returnidentical
"Test Store"

Why

Recorded under OPEN-25.

Rule identifiers are permanent and are never renumbered. Each implementation publishes its own standing against these rules; this specification does not.spec 1.0 · LANG-17 · changed in spec 1.0