A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/tc39/proposal-optional-chaining/issues/74 below:

Destructuring syntax · Issue #74 · tc39/proposal-optional-chaining · GitHub

How about:

const obj = {
  foo: {
    bar: {
      baz: 42,
    },
  },
};

// const baz = obj?.foo?.bar?.baz; 
const { baz } = obj?.foo?.bar?;

It would be a ? operator, so it's certainly out of scope.
But it would be very nice and intuitive to have such a syntax in my humble opinion, so here's the issue.

RusinovAnton, armanozak, imathews, mattdarveniza, stevenvachon and 15 moreMaxmaxmaximusAWS


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4