enum Gender {
Male,
Female,
};
enum Direction {
Up,
Down
}
enum Episode {
NEWHOPE
EMPIRE
JEDI
}
enum TestEnum : int
{
FOO,
BAR,
BAZ
}
flags
A
B
C
D
// A=1, B=2, C=4, D=8
constants
X
Y
Z
W
// X=0, Y=1, Z=3, W=4
enum ExitCode {
Success = 0,
Failure = 1
}
boolCell
enum true false
Languages with Enums include C, C++, TypeScript, Objective-C, GraphQL, C3, Speedie, Jule, Grammar, C2, Tick C, Static Typescript
Languages without Enums include JavaScript, Python, HTML, Ruby, CSS, Cython
This question asks: Does the language have a syntax and type for enums?
Read more about Enums on the web: 1.
HTML of this page generated by Features.ts