Unions
TypeScript - Union types, type guards and type aliases
Union types We can use union types in TypeScript to combine multiple types into one type: let text: string | string[]; Variable text can now be either string or string array which can be pretty handy in some particular cases.