-
-
Save mredem96/fb143059bc59f08459681f02d84072d8 to your computer and use it in GitHub Desktop.
enums
This file contains 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
//this is TypeScript declaration | |
enum Suit { | |
Club, Diamond, Heart, Spade | |
} | |
// in JavaScript like this | |
var Suit; | |
(function(Suit){ | |
Suit[Suit["Club"]=0]="Club"; | |
Suit[Suit["Diamond"]=1]="Diamond"; | |
Suit[Suit["Heart"]=2]="Heart"; | |
Suit[Suit["Spade"]=3]="Spade"; | |
})(Suit||(Suit={})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment