Explore Library
Code QuizBeginner

Enum As Type Annotation

When annotating a variable with an enum type, assign an enum member, not a raw string.

Codetypescript
enum Role {
  Admin = "ADMIN",
  User = "USER"
}

let current: Role = "ADMIN";
console.log(current);

What is the bug in this variable annotation?