Union & Intersection Types#
Union types (A | B) represent values that can be one of several types. Intersection types (A & B) combine multiple types into one. Together they provide powerful type composition without inheritance.
Union Types
Values that can be one of several types
Union types allow a value to be one of several types