enum LetterGrade {
A = 'A',
B = 'B',
C = 'C',
D = 'D',
F = 'F'
}
for (let grade in LetterGrade) {
console.log(grade);
}
The above will give us A to F, but what is below will give us 0 to 4 before A to F and then A to F as well.
enum LetterGrade {
A,
B,
C,
D,
F
}
for (let grade in LetterGrade) {
console.log(grade);
}
No comments:
Post a Comment