Have a look at the following code:
// typescript enum example
enum foo { ONE = 1, TWO = 2, THREE = 3 }
Is it possible to change the value of ONE to 0 in runtime? If yes, how?
Is it possible to change the value of ONE to 0 in runtime? If yes, how?
You can always use a type assertion:
// typescript enum example
enum foo { ONE = 1, TWO = 2, THREE = 3 }
(foo as any).ONE = 0;
More : https://basarat.gitbooks.io/typescript/content/docs/types/type-assertion.html But I don't recommend it.
Why not just write the following in the first place?:
enum foo { ONE = 0, TWO = 2, THREE = 3 }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With