TypeScript · Junior · Question 59 of 75
What does Readonly<User> do?
- ✓Correct answer: Makes every property of
Userread-only (shallowly) - 2Freezes the object at runtime
- 3Makes the properties optional
Explanation
Nested objects remain mutable. At runtime nothing changes; use Object.freeze if you need runtime protection.