📦property access expression
use . / [] / ?. / ?.[] to evaluate object property / array element.
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"
💡Symbol can be used in the
[expr]part of bracket notation [].⛔cannot read properties of nullish❗️ - occurs when obj is nullish.
delete
<expr>returns true if<expr>is not a property access expression.
Last updated
Was this helpful?