JavaScriptSyntax
Optional Chaining
Code example
user?.address?.cityReads a nested property without crashing on null.
In JavaScript, optional chaining: reads a nested property without crashing on null — user?.address?.city
user?.address?.cityuser?.address?.cityReads a nested property without crashing on null.
Use user?.address?.city.
Use this pattern: user?.address?.city
Yes. Use Copy code and adapt the example to your program.
No. The language syntax is the same across operating systems.