Safely Access a Property on a JavaScript Object with Optional Chaining

InstructorLaurie Barth

Share this video with your friends

Send Tweet

You can use optional chaining to access properties of an object. If the parent property exists, it acts as a typical dot accessor. If not, optional chaining prevents an error from being thrown and instead returns undefined.

Free Community Resource

A Community Resource means that it’s free to access for all. The instructor of this lesson requested it to be open to the public.