Check out this playground link for a TypeScript example.
I'm having issues setting the initial value of an enum member using a constant numeric value. Unfortunately, all subsequent values give an error stating "Enum member must have initializer."
Is there a restriction on doing this? Why aren't the following members automatically set to the previous member plus one?
Here's the code in question (also available in the provided playground link):
const firstValue: number = 100;
enum Animal {
Lion = firstValue,
Tiger,
Horse,
Fish
}