In 2020 JavaScript gained a new feature – optional chaining. It solves a problem we've had ... forever. How do you access the 3rd level greet , if object , deepProp , and deeperProp might be undefined? You could rely on JavaScript's evaluation semantics. Last value from expression is returned.

2m read timeFrom swizec.com
Post cover image
Table of contents
The problem optional chaining solvesUse optional chaining
1 Comment