📦property access expression
use . / [] / ?. / ?.[] to evaluate object property / array element.
Last updated
Was this helpful?
use . / [] / ?. / ?.[] to evaluate object property / array element.
Last updated
Was this helpful?
Was this helpful?
JS ⟩ statement ⟩ expression ⟩ operator ⟩ left-hand side ⟩ property access ⟩ expression
(operator)
use .
, []
, ?.
, ?.[]
, ?.()
to evaluate the value of object property / array element.
// ⭐️ (normal) chaining
obj . identifier // dot notation
obj [ expr ] // bracket notation (no "dot"❗️)
// ⭐️ optional chaining
obj ?. prop // dot notation
obj ?. [ expr ] // bracket notation
func ?. ( args ) // optional invocation
🈯 synonyms: "property accessor", "property access expression", "chaining"
the "obj
" part of the property accessor:
the expression before .
/ [
(the obj
part) is first evaluated.
if the is / , is thrown.
use (?.
/ ?.[]
) to guard againt this case.