“TS enum” Respostas de código

TS enum

enum vscode {
    good,bad,medium
}

console.log(vscode.bad)
Skull Sherbet

Enum datilografado

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

Respostas semelhantes a “TS enum”

Perguntas semelhantes a “TS enum”

Mais respostas relacionadas para “TS enum” em TypeScript

Procure respostas de código populares por idioma

Procurar outros idiomas de código