Skip to main content
Frontend
Interviews
.dev
Problems
739. TypeScript Enum vs Union Trade-off
Medium
•
...
Select the best answer.
type
Status
=
'idle'
|
'loading'
|
'done'
;
Why often prefer literal unions for simple states?
Enums unsupported
Unions are runtime objects
Zero runtime emit and easy composition
Enums cannot narrow
Submit Answer
Reveal Answer
Select an option and submit your answer.
Next Problem
Auto-advance on correct answer