Key Concepts

Review core concepts you need to learn to master this subject

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.

Union Types
Lesson 1 of 1

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo