Union Types
TypeScript union types allow us to combine individual types into flexible combinations.
StartKey Concepts
Review core concepts you need to learn to master this subject
TypeScript Union Type
TypeScript Union Type Syntax
TypeScript Union Type Narrowing
TypeScript Function Return Union Type
TypeScript Union of Array Types
TypeScript Union Type Common Property Access
TypeScript Union of Literal Types
TypeScript Union Type
TypeScript Union Type
let answer: any; // any type
let typedAnswer: string | number; // union type
TypeScript allows a flexible type called any that can be assigned to a variable whose type is not specific. On the other hand, TypeScript allows you to combine specific types together as a union type.
What you'll create
Portfolio projects that showcase your new skills
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory