Skip to main content
InterviewHubPRO
Section Overview
Q284

Question 284 of 536

Part 5: ES6+ Modern Syntax, Classes, Modules & Destructuring (254 - 328)

53%
JavaScript & V8 Internals (536 Qs)•Part 5: ES6+ Modern Syntax, Classes, Modules & Destructuring (254 - 328)

What is an enum

junior LevelCode ExampleTypeScript

An enum is a type restricting variables to one value from a predefined set of constants. JavaScript has no enums but typescript provides built-in enum support.

javascript
  enum Color {
   RED, GREEN, BLUE
  }