Skip to content

Instantly share code, notes, and snippets.

@mredem96
Last active February 11, 2019 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mredem96/fb143059bc59f08459681f02d84072d8 to your computer and use it in GitHub Desktop.
Save mredem96/fb143059bc59f08459681f02d84072d8 to your computer and use it in GitHub Desktop.
enums
//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