- Notifications
You must be signed in to change notification settings - Fork 13.1k
Open
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
Every time I type an undefinable variable, I think I typed something wrong:
let a: string | undefined;Why do I think I did something wrong? It's because I never add undefined type to a union type as above except in variable declarations.
Don't you think it is time, introduce the optional operator to local variable declarations as well?
let a?: string;The above syntax feel very natural and idiomatic typescript for me.
alex3165, lucabrunox, chdh, aleksanb, jackwilsdon and 215 moretrotylctjlewis, Taranys, saikatdas0790, guyca, opensas and 3 moresaikatdas0790 and zolomatok
Metadata
Metadata
Assignees
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScriptAn idea for TypeScript