Keyed Enum Values in TypeScript
Values in enumerations can be accessed by numeric keys, just like array elements:
enum Season { Winter, Spring, Summer, Autumn };
let current: string = Season[0];
console.log(current); // 'Winter'
Tell me what the result of running the following code will be:
enum Fruits { Apples, Bananas, Oranges, Grapes };
let myFruit: string = Fruits[2];
console.log(myFruit);