$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · hard · #124

What is logged?

enum Dir { Up = 1, Down }
console.log(Dir.Down, Dir[2]);
  1. 2 Down
  2. 1 Up
  3. 2 2
  4. Down 2
Members auto-increment, and a numeric enum also maps values back to names.
Play Problem Solving ▸