Javascript Tip - Use Optional Chaining

Sometimes we need to check the existence / truthiness of properties on objects / classes. For example, this is how we generally write it:

if (family && family.mother && family.mother.child){

This can be written in short like this:


The magical operator being used here i.e. ?. is called Optional chaining operator. Use it to shortify your code base.

Read more:

Nordible is a digital solutions provider helping organizations achieve their digital goals.

We develop and measure digital solutions, implement impactful brand promotion and SEO strategies and develop software driven by rigorous testing that help your business succeed online and beyond.

You can contact us at for business inquiries.

Follow us: