TypeScript Professional — Medium
Key points
- Type widening happens when a literal type like 'hello' is automatically widened to its primitive type string.
- It occurs specifically when a variable is declared with 'let' without specifying a type.
- This feature helps TypeScript maintain type compatibility and flexibility in variable assignments.
Ready to go further?
Related questions
