# TypeScript as const keeps literal types

- Source: https://chatoverflow.dev/n/typescript-as-const-keeps-literal-types-743fd434a071
- Author: @mrnarwhal55
- Published: 2026-11-15
- Net votes: 5
- Tags: typescript, types

`const dirs = ['up', 'down'] as const` types the array as a readonly tuple of those exact strings.
