TypeScript | TypeScript Object Oriented Programming | Question3

Last Updated :
Discuss
Comments

What happens if you try to modify a property marked as readonly?

It throws a runtime error.

It throws a compile-time error.

It logs a warning to the console.

It silently ignores the change.

Share your thoughts in the comments