Created
October 28, 2018 02:01
-
-
Save tkssharma/c2edc77e8ff4063a38771402661cd0e7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Weather { | |
Sunny, | |
Cloudy, | |
Rainy, | |
Snowy | |
} | |
let today: Weather = Weather.Cloudy; | |
let tomorrow: Weather = 200; | |
console.log("Today value", today); // Today value Cloud | |
console.log("Today key", Weather[today]); // Today key undefined | |
enum Weather1 { | |
Sunny = 100, | |
Cloudy, | |
Rainy = 200, | |
Snowy | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment