TypeScript · Lesson 26 of 120
Intersection Types
Combine shapes.
With type aliases, you combine shapes using an ampersand. The result has every property from both sides. That's an intersection type.

- Ampersand
- Both shapes
- Intersection
Combining with &
Timestamps holds when something was created. A tracked order is an order and timestamps together. It must have every property from both. Run it.
app.tstypescript
type Order = { id: number; total: number };
type Timestamps = { createdAt: string };
type TrackedOrder = Order & Timestamps;
const order: TrackedOrder = { id: 1042, total: 65, createdAt: "2026-11-13" };
console.log(order);Output
{ id: 1042, total: 65, createdAt: '2026-11-13' }extends or &
Both combine shapes. Extends is for interfaces, and gives clearer error messages. Ampersand works with any type alias, even unions. Use whichever matches the style you chose.
| key | value |
|---|---|
| extends | interfaces |
| & | type aliases |
| Errors | extends is clearer |
| Choose | match your style |
Summary
An ampersand combines types, so the result has every property from both. Next, index signatures.
Key takeaways- A & B
- Every property
- Type aliases
Next up: Index Signatures — dictionaries