Giá trị enum theo khóa trong TypeScript

Giá trị trong enum có thể được lấy theo các khóa số, tương tự như các phần tử mảng:

typescriptenum Season { Winter, Spring, Summer, Autumn };
let current: string = Season[0];
console.log(current); // 'Winter'
Задание 1

Hãy cho biết kết quả thực thi của đoạn mã sau:

typescriptenum Fruits { Apples, Bananas, Oranges, Grapes };
let myFruit: string = Fruits[2];
console.log(myFruit);