We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently there is shorter syntax for optional named fields, the question mark next to the field name, field?: string means field: string | undefined.
field?: string
field: string | undefined
Could this syntax be extended from named fields to all types in general? For example string? would mean string | undefined.
string?
string | undefined
It would allow using this shorter syntax in function return types:
Proposed syntax:
function identity(value: string?): string? { return value; }
Current syntax:
function identity(value?: string): string | undefined { return value; }
(This should stay supported for backward compatibility.)
The text was updated successfully, but these errors were encountered:
@zakjan have fun in #7426
Sorry, something went wrong.
No branches or pull requests
Currently there is shorter syntax for optional named fields, the question mark next to the field name,
field?: string
meansfield: string | undefined
.Could this syntax be extended from named fields to all types in general? For example
string?
would meanstring | undefined
.It would allow using this shorter syntax in function return types:
Proposed syntax:
Current syntax:
(This should stay supported for backward compatibility.)
The text was updated successfully, but these errors were encountered: