TypeScript · Junior · Question 53 of 75
What type does const direction = 'left'; get?
- ✓Correct answer: The literal type
'left' - 2
string - 3
any
Explanation
A const can't be reassigned, so TypeScript keeps the literal. With let direction = 'left' it widens to string.