Type Aliases and Interfaces
Compare and use type aliases and interfaces.
1
Type Aliases and Interfaces
Welcome to the next lesson! In this lesson, you’ll learn about type aliases and interfaces in TypeScript, including their differences, similarities, and when to use each. Let’s get started!

2
What Are Type Aliases?
A type alias allows you to define a custom name for a type. It can represent primitive types, objects, or even function signatures.
Example:
Task: Create a type alias for an object representing a book and use it to define a variable.
type Point = {
x: number;
y: number;
};
let point: Point = { x: 10, y: 20 };
console.log(point);
// Output: { x: 10, y: 20 }
All lessons in this course
- Generics
- Type Aliases and Interfaces
- Utility Types
- Type Guards