Intersection Types: A and B
Combine types with & to merge their properties.
Welcome
Intersection types combine multiple types into one. A value of an intersection type must satisfy ALL of the combined types simultaneously.
Basic Intersection Syntax
Use the `&` operator to create an intersection. The result has all properties of both types.
type Named = { name: string };
type Aged = { age: number };
type Person = Named & Aged;
const alice: Person = { name: 'Alice', age: 30 };