LESSON 1.3

Literal types and const assertions

05:38·19,825 learners
Daniel OkaforDaniel Okafor
Next lesson

In this lesson you will

  • Understand literal widening and when it happens
  • Freeze a literal shape with as const
  • Derive a union of allowed values from a constant array

Widening is why your string turned into string. A const assertion keeps the literal, which is what makes union-of-literals modelling work.

What this lesson covers

  • Understand literal widening and when it happens
  • Freeze a literal shape with as const
  • Derive a union of allowed values from a constant array

This lesson sits in How the Type System Thinks, part of TypeScript for Application Developers. It assumes what came before it and leads directly into the next lesson in the module.

UP NEXT

2.1 · Generic functions and inference

12:52

TypeScript for Application Developers

17%

Every lesson, searchable to the second.

© 2026 BIBLION

PRIVACY · TERMS · CONTACT