TypeScript · Middle · Question 32 of 75
What are decorators in TypeScript 5?
- ✓Correct answer: Functions applied to classes and their members via
@ - 2Special comments for generating TSDoc documentation
- 3Syntax for declaring React components as classes
Explanation
TS 5.0 supports standard (stage 3) decorators without a flag. The legacy "experimental" decorators (experimentalDecorators) with a different API are used in Angular, NestJS and TypeORM. Uses: logging, DI, validation, metadata.