Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

ts enum

// String enum 
enum Direction {
  Up = "UP",
  Down = "DOWN",
  Left = "LEFT",
  Right = "RIGHT",
}

// Numeric enums
enum Direction {
  Up = 1,
  Down,
  Left,
  Right,
}
Source by www.typescriptlang.org #
 
PREVIOUS NEXT
Tagged: #ts #enum
ADD COMMENT
Topic
Name
2+4 =