Author Archives: Dave Pease

Optional Chaining in JavaScript

Interactive Business Systems is now Planet Technology. Looking for a new job? We work with some of the biggest names in tech, and we’re hiring! Check out our open jobs and make your next career move with Planet.

Optional chaining is in stage 1 and can be found in this repo. Optional Chaining provides a succinct way to check for the existence of an object before accessing its properties.  Very similar to the C# null conditional operator. And it is already available in the React ecosystem.

Why do we need this?

How often are we checking for existence of an object after an API call? Yes, almost always requiring us to write code like this to prevent errors due to JavaScript’s nature of allowing unstructured anonymous objects. Read more