DEV Community

Viral Patel
Viral Patel

Posted on • Originally published at viralpatel.blog on

Optional Chaining in JavaScript

Optional chaining enables capabilities for Javascript developers to perform a nil check on the objects before trying to access any object properties.

As an example:

this.props?.user?.email

Optional Chaining behaves similarly to Ruby’s pretzel(&) operator.

Check out the official babel documentation. Babel - Optional Chaining

Top comments (0)