Leverage union types in Typescript to avoid invalid states

from blog zabirauf || Zohaib, | ↗ original
Typescript has a type system which provides more capabilities than the type system in C# and Java. The one that I found to be very useful is the union type in Typescript. Let's define what a union type is Union Type In javascript libraries you might see that