5) Typescript Union Types
Union TypesA Union Type allows a variable to hold multiple possible types. A union type is created using the | (pipe) symbol between the types.
type Status = "loading" | "success" | "error";
// OR
let
careerpath.hashnode.dev3 min read