← All Exercises
Enum Iteration and Reverse Mapping
basictypescript
Background
Enum iteration is useful for generating dropdowns, validation lists, and configuration options.
Problem
Given a TypeScript enum, iterate over its values and demonstrate reverse mapping for numeric enums.
Input
A TypeScript enum
Output
Array of enum values and names
Sample tests
Sample 1
Input: enum Color {Red, Green, Blue}Expected: [0, 1, 2]
Your solution
Learning objective
Understand enum internals and iteration patterns