Explain it in 60 seconds
Union types
Frontend Engineering · TypeScript · Beginner
What are union types, and how do you work with them?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Value can be one of several types (string or number).
- Only common members accessible directly.
- Narrow before using specific members.
- Literal unions model options.
- Common in APIs and state.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.