Typescript: understanding the "readonly" modifier

Example:

readonly name: string;
The "readonly" modifier ensures that a property cannot be modified after it's set.

Solution:

// Use "readonly" for properties that shouldn't be changed after object creation.

Beginner's Guide to TypeScript