Back to questions
JuniorTheoryCommon
What does the program print?
enum Level { Low, Mid = 5, High }
console.log(Level.Low, Level.High);0 6
- Expecting
0 2: a member without a value takes the previous member's value plus one, soHigh, right afterMid = 5, gets6. - Expecting the names
Low High: a numeric enum member's value is a number, andconsole.logprints that number.
- What does
Level[6]evaluate to, and why? - What does tsc write to the
.jsfile for thisenum?