Skip to content

Request Feature: Ability to declare optional variable with '?' #49477

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

Closed
joe88ds opened this issue Jun 10, 2022 · 2 comments
Closed

Request Feature: Ability to declare optional variable with '?' #49477

joe88ds opened this issue Jun 10, 2022 · 2 comments

Comments

@joe88ds
Copy link

joe88ds commented Jun 10, 2022

⭐ Suggestion

Let us declare local variables as optional

💻 Use Cases

const x: Type? = y;
let x: Type?;
and this would translate to:
const x: Type | undefined = y;
let x: Type | undefined = undefined;

🔍 Search Terms

optional variable

@MartinJohns
Copy link
Contributor

You forgot to fill out the issue template.

Duplicate of #41901.

@joe88ds
Copy link
Author

joe88ds commented Jun 10, 2022

Closed as been discussed in #41901

@joe88ds joe88ds closed this as completed Jun 10, 2022
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