Decorators
Last updated
What is Decorators?
Decorators are a special kind of declaration that can be attached to a class declaration, method, accessor, property, or parameter. They use the form @expression, where expression must evaluate to a function that will be called at runtime with information about the decorated declaration. Decorators provide a way to add both annotations and a meta-programming syntax for class declarations and members. They essentially modify the behavior or functionality of the decorated code in a declarative way.
Free resources to learn Decorators
- Official docsDecorators
Decorators: common questions
Can I learn Decorators in Hindi?
This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain Decorators in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.
Is this Decorators tutorial for beginners?
It is lesson 76 of 93 in the free TypeScript roadmap, in stage 12, Decorators. If you are new to TypeScript, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.