... and the obligatory Objects vs Enums
const EEVEELUTIONS = { Eevee: 133, Vaporeon: 134, Jolteon: 135, Flareon: 136, Espeon: 196, Umbreon: 197, Leafeon: 470, Glaceon: 471, Sylveon: 700, } as const; // Resulting in // type Eeveelutions = 133 | 134 | 135 | 136 | 196 | 197 | 470 | 471 | 700 type Eeveelutions = typeof EEVEELUTIONS[keyof typeof EEVEELUTIONS]; const basicPokemon = EEVEELUTIONS.Eevee; console.log(basicPokemon); const Sylveon = EEVEELUTIONS.Sylveon; console.log(Sylveon);
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
... and the obligatory Objects vs Enums