JavaScript optional chaining (?.) to the rescue
Optional chaining has been added to the ES2020 version of JavaScript and is also available in TypeScript.
Optional chaining is a warmly welcomed way to access child properties, even when they don't exist!
Let's sketch a simple user object.
const user...
h.daily-dev-tips.com3 min read
Chirag Dev
This is great. Never knew about this.