JavaScript introduced two powerful operators in ES2020 to handle nullable values more elegantly: Optional Chaining (?.) and Nullish Coalescing (??).
Optional Chaining (?.)
The optional chaining operator accesses a property or calls a function only if the operand before it is not null or undefined. If it is, the expression short-circuits and returns undefined immediately, avoiding the dreaded TypeError: Cannot read properties of undefined.