Member-only story
Optional Chaining, Null Coalescing and How They Will Change the Way You Write Code
A safer and more ergonomic way to write code to access object properties

If you have been following TypeScript releases recently you already know that Optional Chaining and Nullish Coalescing were introduced in TypeScript 3.7. They are both part upcoming features of the JavaScript and as of the time of publishing this piece, they are at stage 4 and stage 3 respectively.
UPDATED: As of Babel 7.8.0 These features are also included by default.
Optional Chaining
Quite often we find ourselves working deep into an object to get the value of a property. If you’ve written more than 100 lines of code in JavaScript you know that, when not done right, this can be the root of a common error: Uncaught TypeError
.

We are going to use this mock response for the rest of the examples:
