Union Types is a historical design pattern. In computer science, a union is a value that may have any of several representations or formats within the same position in memory; that consists of a variable that may hold such a data structure. Some programming languages support special data types, called union types, to describe such values and variables. In other words, a union type definition will specify which of a number of permitted primitive types may be stored in its instances, e.g., "float or long integer". Read more on Wikipedia...
- Union Types ranks in the top 50% of entities I track
- the Union Types wikipedia page
- I have 13 facts about Union Types. what would you like to know? email me and let me know how I can help.
Languages with Union Types include typescript
Example from typescript:
declare type numOrString = string | number
Last updated September 6th, 2019