NestJS · Junior · Question 20 of 75
What is a DTO in Nest?
- ✓Correct answer: A Data Transfer Object: a class describing the shape of incoming or outgoing data, often with validation decorators
- 2A type of middleware
- 3A database table
Explanation
Classes are used rather than interfaces because they exist at runtime, so pipes can validate and transform them.