Problem Statement
Prefer as const object for constants because…
Explanation
`as const` freezes property mutability at the type level and preserves literal values (e.g., `'UP'` not `string`). It often compiles to simple objects with no enum helpers, which can reduce bundle overhead.
Code Solution
SolutionRead Only
const DIR = { Up: 'UP', Down: 'DOWN' } as const;
type Dir = typeof DIR[keyof typeof DIR]; // 'UP' | 'DOWN'