Union Types Quiz
Multiple Choice Easy
Question
What does the type `string | number` represent?
Hint
The pipe symbol | means 'or' in TypeScript types.
Explanation
The union type string | number means a value can be either a string or a number — but not necessarily both at once. The pipe | reads as 'or'. TypeScript will only let you use properties common to both types without narrowing.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.