TypeScript card revieweasy
What are Literal Types in TypeScript?
Literal Types allow variables to accept only specific values rather than an entire primitive type. For example, a variable can be restricted to only 'success', 'error', or 'loading'. This improves type safety by preventing invalid values and making APIs more predictable. Literal types are commonly combined with union types to create strongly typed application states.