Skip to main content
The & operator in TypeScript creates an intersection type, combining multiple types into a single type that enforces the constraints of all constituent types simultaneously. An entity of an intersection type must satisfy the structural contracts of every type included in the intersection.

Object Type Intersections

When applied to object types, the & operator creates a type that is structurally equivalent to an object containing the union of all property keys from the intersected types. TypeScript does not eagerly flatten or merge these into a new single object type signature; the internal representation remains an intersection, and properties are recursively intersected rather than merged.

Overlapping Properties

If constituent object types share a property key, the TypeScript compiler recursively intersects the types of that specific property. If the shared property contains object types, the intersection is applied to those nested objects:
If the shared property contains mutually exclusive primitive types, the resulting property type resolves to never, as a value cannot simultaneously be multiple distinct primitives.
Crucially, if the shared property acts as a discriminant containing mutually exclusive literal types, the entire intersection type reduces to never, rather than just the individual property.

Primitive Intersections

Applying the & operator directly to mutually exclusive primitive types always yields the bottom type, never.

Top and Bottom Types

The intersection operator has specific, defined interactions with TypeScript’s special top and bottom types:
  • any: Intersecting any type T with any yields any (T & any = any).
  • unknown: Intersecting any type T with unknown acts as an identity operation, yielding T (T & unknown = T).
  • never: Intersecting any type T with the bottom type never yields never (T & never = never).

Function Overloading

When intersecting function signatures, the & operator creates a single function type with multiple call signatures (an overloaded function). The compiler evaluates these signatures in the order they are intersected.

Distributivity over Unions

The intersection operator distributes over the union operator (|). When an intersection is applied to a union type, TypeScript applies the intersection to each member of the union individually.
Tired of Poor TypeScript Skills? Fix That With Deep Grasping!Learn More