Add string
keyword to enum declaration to automatically generate identical key/values for the enum
#39755
Closed
5 tasks done
Labels
Duplicate
An existing issue was already created
Search Terms
string enum
Suggestion
Many of our enums use identical strings and values. In fact, my team never uses numeric enums (and I do only rarely). It would be nice if there was a shortcut for this behavior.
Use Cases
I'd use this whenever I make an enum with identical keys and string values.
Examples
Current required syntax
JavaScript output
Desired syntax
Expected JavaScript output (identical)
Checklist
My suggestion meets these guidelines:
I'm pretty sure this syntax pattern is still available.
The text was updated successfully, but these errors were encountered: