TypeScript card review1 min read
easy

What are Enums in TypeScript?

Enums are a TypeScript feature that allows developers to define a collection of named constants. They make code more readable and maintainable by replacing magic numbers or strings with meaningful names. TypeScript supports numeric enums, string enums, and heterogeneous enums. Enums are commonly used to represent fixed sets of values such as user roles, application states, or status codes. They provide compile-time checking and autocomplete support, reducing errors caused by invalid values.

Share this Resource

Spread the knowledge with other engineering candidates.

Was this card helpful?

Help us rank high-quality interview preparation materials.

Accelerate Your Prep

Get instant feedbacks, dynamic voice simulations, and keyword scorecard matchers.

JB

Jeevan Bhargav

Audited by Creator

This answer is calibrated for technical interviews. Verify benchmarks in local sandboxes before deploying.