Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional chaining not supported #65

Open
azw413 opened this issue Oct 28, 2021 · 2 comments
Open

Optional chaining not supported #65

azw413 opened this issue Oct 28, 2021 · 2 comments

Comments

@azw413
Copy link

azw413 commented Oct 28, 2021

Apologies for keeping you busy ! These are very new so I fully understand if you don't support them :-

let vehicle = {
};

let vehicle1 = {
    car: {
        name: 'ABC',
        speed: 90
    }
};


console.log(vehicle.car?.name); // Undefined
console.log(vehicle.car?.speed); // Undefined

console.log(vehicle1.car?.name); // ABC
console.log(vehicle1.car?.speed); // 90

yields the following error :- UnexpectedToken(Position { line: 12, column: 25 }, "Expected {, [, or (; found Punct(Period)")

@FreeMasen
Copy link
Collaborator

The general goal is to support features that have made it to stage 3 in the proposal process. In a quick glance across the proposal stages, I wasn't able to find the ? operator, do you know where the proposal is currently?

There is an issue on this repo about currently unimplemented stage 3 features that I try an keep up to date

@azw413
Copy link
Author

azw413 commented Oct 20, 2023

It looks like these are Stage 4 now :-
https://github.com/TC39/proposal-optional-chaining
https://github.com/tc39/proposal-nullish-coalescing
This article describes all the 'new' things in es2020: https://www.w3schools.com/js/js_2020.asp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants