TypeScript card revieweasy

What is the Readonly modifier in TypeScript?

The readonly modifier prevents properties from being modified after initialization. It helps enforce immutability and protects critical data structures from accidental changes. Readonly can be applied to object properties, arrays, tuples, and mapped types.

JB

Jeevan Bhargav

Audited by Creator

This answer is calibrated for technical interviews. Verify benchmarks in local sandboxes before deploying.