What are Decorators, and how do you use them to modify a class property?
Instruction: Explain the concept of Decorators and demonstrate their use in modifying a class property with an example.
Context: Although Decorators are mentioned in the initial list, this question dives deeper into their practical application, specifically in modifying class properties, to gauge the candidate's expertise in advanced TypeScript features.
Updated
Official answer available
Read the opening below, then unlock the full answer and practical guidance.
For property validation, I would avoid storing the value in a decorator closure on the class prototype, because that can accidentally share state across instances...