Skip to content

Glossary: TypeScript Basics

as const

Also written: const assertion

Written after a value, it marks the value as never changing: properties become `readonly` and keep their literal types. `["12 oz", "5 lb"] as const` is a read-only list of two exact strings.

Where the book teaches it

Related terms

literal typereadonlywidening