# tc39/proposal-optional-chaining

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/tc39-proposal-optional-chaining).**

4,913 stars · 70 forks · HTML · archived

## Links

- GitHub: https://github.com/tc39/proposal-optional-chaining
- Homepage: https://tc39.github.io/proposal-optional-chaining/
- awesome-repositories: https://awesome-repositories.com/repository/tc39-proposal-optional-chaining.md

## Description

This project is an ECMAScript language proposal and JavaScript syntax extension designed to simplify the process of accessing nested properties. As a TC39 Stage 4 proposal, it provides a finalized standard for adding optional chaining to the JavaScript language.

The extension prevents runtime errors when reading properties of null or undefined references. This allows for the safe retrieval of values from deep object chains and the execution of functions within a sequence without manually verifying every level of the hierarchy.

The proposal covers data access capabilities including the ability to read deeply nested properties, call functions optionally, and delete optional properties. These features facilitate JavaScript object navigation and error prevention when handling complex data structures.

## Tags

### Programming Languages & Runtimes

- [Safe Nested Property Access](https://awesome-repositories.com/f/programming-languages-runtimes/safe-nested-property-access.md) — Provides a concise syntax for reading deeply nested properties while returning null if any reference in the chain is missing. ([source](https://tc39.github.io/proposal-optional-chaining/))
- [Runtime Reference Validations](https://awesome-repositories.com/f/programming-languages-runtimes/class-member-access/object-member-access/runtime-reference-validations.md) — Ensures a base object exists at runtime before attempting to access nested properties or call functions.
- [ECMAScript Proposal Implementations](https://awesome-repositories.com/f/programming-languages-runtimes/ecmascript-proposal-implementations.md) — Serves as a formal ECMAScript specification and implementation for adding optional chaining to the language.
- [ECMAScript Syntax Extensions](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/language-features/language-extensions/ecmascript-syntax-extensions.md) — Adds a new syntactic construct to the ECMAScript specification to prevent errors when reading null or undefined references.
- [Null Reference Error Preventions](https://awesome-repositories.com/f/programming-languages-runtimes/null-reference-error-preventions.md) — Prevents runtime crashes when attempting to call functions or access properties on null or undefined variables.
- [Property Access Syntax](https://awesome-repositories.com/f/programming-languages-runtimes/object-property-interceptors/property-access-syntax.md) — Introduces a new property access syntax that allows safe retrieval of values from deep object chains. ([source](https://cdn.jsdelivr.net/gh/tc39/proposal-optional-chaining@main/README.md))
- [Optional Function Calls](https://awesome-repositories.com/f/programming-languages-runtimes/optional-function-calls.md) — Allows executing functions within a sequence while safely returning null if the target function does not exist. ([source](https://tc39.github.io/proposal-optional-chaining/))
- [Safe Object Navigation](https://awesome-repositories.com/f/programming-languages-runtimes/safe-object-navigation.md) — Enables accessing deeply nested properties in JavaScript objects without manual existence checks for every level.
- [Operator Token Translations](https://awesome-repositories.com/f/programming-languages-runtimes/abstract-syntax-tree-parsers/operator-token-translations.md) — Implements the translation of optional chaining operators into conditional branching logic during compilation.
- [Conditional Access Simplifications](https://awesome-repositories.com/f/programming-languages-runtimes/anonymous-functions/syntax-simplifications/conditional-access-simplifications.md) — Replaces verbose conditional checks with a concise syntax when retrieving values from nested hierarchies.
- [Stage 4 Standardized Implementations](https://awesome-repositories.com/f/programming-languages-runtimes/ecmascript-proposal-implementations/stage-4-standardized-implementations.md) — Provides a finalized Stage 4 standard for optional chaining, ready for implementation across all JavaScript engines.

### Data & Databases

- [Optional](https://awesome-repositories.com/f/data-databases/object-property-accessors/deep-object-manipulations/property-deletions/optional.md) — Enables removing specific properties from an object without triggering errors if the parent object is missing. ([source](https://tc39.github.io/proposal-optional-chaining/))

### Software Engineering & Architecture

- [Short-Circuit Operators](https://awesome-repositories.com/f/software-engineering-architecture/boolean-logic-extractors/truthiness-evaluators/short-circuit-operators.md) — Implements short-circuit evaluation that stops property access chains immediately upon encountering a null or undefined value.
- [Sentinel Value Propagation](https://awesome-repositories.com/f/software-engineering-architecture/optional-value-types/sentinel-value-replacement/sentinel-value-propagation.md) — Propagates a sentinel undefined value upward when an optional chain fails to resolve a reference.

### Web Development

- [Nullish Short-Circuiting](https://awesome-repositories.com/f/web-development/middleware-pipelines/pipeline-short-circuiting/nullish-short-circuiting.md) — Provides short-circuiting logic that halts the chain and returns the current value when a null or undefined reference is encountered.
