-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
DuplicateAn existing issue was already createdAn existing issue was already created
Description
A string enum is inferred by looking at the constant value of the initializer of its first member:
enum stringsInferred {
a = "a",
b, // "b"
c // "c"
}
Or it is declared using a string index:
enum stringsDeclared {
[prop: string] : string;
a, // "a"
B, // "B"
c // "c"
}
The auto initialized value on an enum is its property name.
Inferred enum special case
enum stringsLowerCase {
Shoes = "shoes", // If the first member has lowercase chars, then lowercase all other member values
Boots, // "boots"
Feet // "feet"
}
mohsen1, michaelmesser, garkin, plantain-00, mquandalle and 234 morenormalser, davidjsalazarmoreno, avchugaev, vteivans, piotrwitek and 8 moreandersborum, normalser, davidjsalazarmoreno, avchugaev, vteivans and 13 more
Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already created