Typescript: using union and intersection types
Example:
type CombinedType = TypeA & TypeB;
Union and Intersection types offer flexible ways to work with multiple types.
Solution:
// Use union (|) and intersection (&) operators to combine multiple types.