How to set more than one type for a variable in TypeScript?
Originally Published Here ๐!
To set more than one type for a variable, we can define a union type for the variable.
Union types contain more than one type separated by the | symbol (vertical slash).
TL;DR
// union type declaration
let nums: string |...
melvingeorge-me.hashnode.dev2 min read