Optional Chaining in JavaScript

by Jack Pritchard

Hey! This post's a little over two years old now, so some of what's here might be out of date. Still worth a read, but if anything really matters to you, it's worth double-checking against a newer source too.

In this video, I show you how to make use of "Optional Chaining" a new operator available to modern JavaScript applications.

Optional chaining allows us to reference keys if the parent value is defined, as well as reference methods on values when available (e.g. .toUpperCase).