TypeScript handbook
The official reference for the tools used in this lesson.
Lesson 1.3
Widening is why your string turned into string. A const assertion keeps the literal, which is what makes union-of-literals modelling work.
Widening is why your string turned into string. A const assertion keeps the literal, which is what makes union-of-literals modelling work.