TypeScript · Senior · Question 73 of 75
What does Object.freeze return in terms of types?
const config = Object.freeze({ mode: 'dark', retries: 3 });- ✓Correct answer:
Readonly<...>of the object with literal types for primitive properties (shallow, like the runtime behavior) - 2
any - 3A deeply readonly type
Explanation
Nested objects are neither frozen at runtime nor readonly in the type. as const makes all levels readonly at the type level only.