Closed
Description
openedon May 17, 2015
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"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment