Optional Chaining Operator (?.)
GPTKB entity
Statements (18)
Predicate | Object |
---|---|
gptkbp:instanceOf |
JavaScript language feature
|
gptkbp:availableOn |
modern JavaScript engines
|
gptkbp:category |
operator
|
gptkbp:compatibleWith |
gptkb:Internet_Explorer
|
gptkbp:documentation |
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining
|
gptkbp:hasSyntax |
func?.(args)
obj?.[expr] obj?.prop |
https://www.w3.org/2000/01/rdf-schema#label |
Optional Chaining Operator (?.)
|
gptkbp:introducedIn |
gptkb:ECMAScript_2020
|
gptkbp:prevention |
TypeError when accessing undefined or null properties
|
gptkbp:purpose |
safely access nested object properties
|
gptkbp:relatedTo |
Nullish Coalescing Operator (??)
|
gptkbp:standardizedBy |
gptkb:ECMA_International
|
gptkbp:symbol |
?.
|
gptkbp:usedIn |
gptkb:JavaScript
|
gptkbp:bfsParent |
gptkb:ES2020
|
gptkbp:bfsLayer |
6
|