`readonly` is a member modifier on types/classes—it blocks reassignment via that property. `as const` applies to a value expression—freezes array/object elements at the type level and preserves literal types. Use `readonly` to lock fields on your types; use `as const` to keep literals narrow and prevent accidental mutation of the value.
Example code
// readonly property
class C { readonly id = 'u1'; }
const c = new C();
// c.id = 'u2'; // ❌ cannot assign
// as const expression
const ROLES = ['admin', 'user'] as const; // readonly ['admin','user']
type Role = typeof ROLES[number]; // 'admin' | 'user'
const CONFIG = { mode: 'prod', retries: 3 } as const;
// CONFIG.mode is 'prod', not string