“ts enum” Code-Antworten

ts enum

enum vscode {
    good,bad,medium
}

console.log(vscode.bad)
Skull Sherbet

Typscript Enum

enum Direction {
  Up = 1,
  Down,
  Left,
  Right,
}
We’ll first start off with numeric enums, which are probably more familiar if you’re coming from other languages. An enum can be defined using the enum keyword.

If we wanted, we could leave off the initializers entirely:
enum Direction {
  Up,
  Down,
  Left,
  Right,
}
  
enum Direction {
  Up = "UP",
  Down = "DOWN",
  Left = "LEFT",
  Right = "RIGHT",
}
Faris Abuali

ts enum

enum Direction {
  Up = 1,
  Down,
  Left,
  Right,
}
Try
Wide-eyed Willet

Ähnliche Antworten wie “ts enum”

Fragen ähnlich wie “ts enum”

Weitere verwandte Antworten zu “ts enum” auf TypeScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen