Interview practice question
Migrating from enums to union types
Frontend Engineering · TypeScript · Experienced
Your team decides to replace TypeScript enums with string unions and const objects. How would you migrate safely?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- as const object + derived union type.
- Keep same runtime values.
- Codemod usages.
- Watch numeric enums and reverse mapping usage.
- isolatedModules/verbatimModuleSyntax benefits.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.