Union in Typescript
Jul 13, 2024 · 1 min read · Union in typescript allows the variable to hold more than one type of value. It is useful when variable can be of various types. It is defined by | operator between types. //Simple Union let randomValue:string|number=12; randomValue="John Doe"; //ran...
Join discussion