JavaScript optional chaining

Provides safe access to descendent object members with parents that may or may not be null. This applies to objects as well as functions. For example, consider an object reference with three levels such as a.b.c. Testing for the existence of c would previously require nesting said test inside a test for b. This change allows you to test for c directly without an error being thrown when b is null.

Optional Chaining reached Stage 3 at the July 2019 TC39 meeting.

Documentation

Specification

Working draft or equivalent

Status in Chromium

Blink>JavaScript>Language


Behind a flag (tracking bug) in:

  • Chrome for desktop release 79
  • Chrome for Android release 79

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

Owners

Intent to Implement url

Intent to Implement thread

Last updated on 2019-10-28