TypeScript Exercises
Test your TypeScript skills with exercises from all categories:
Exercises
Introduction3 exercises
Get Started3 exercises
Simple Types3 exercises
Explicit Types and Inference3 exercises
Special Types3 exercises
Arrays3 exercises
Tuples2 exercises
Object Types3 exercises
Enums3 exercises
Aliases & Interfaces3 exercises
Union Types3 exercises
Functions4 exercises
Casting4 exercises
Classes4 exercises
Basic Generics3 exercises
Utility Types4 exercises
Keyof4 exercises
Null3 exercises
Definitely Typed2 exercises
TypeScript 5 Updates2 exercises
Configuration3 exercises
Node.js3 exercises
React2 exercises
Tooling2 exercises
Advanced Types3 exercises
Type Guards4 exercises
Conditional Types3 exercises
Mapped Types4 exercises
Type Inference3 exercises
Literal Types4 exercises
Namespaces4 exercises
Index Signatures4 exercises
Declaration Merging3 exercises
Async4 exercises
Decorators4 exercises
JSDoc4 exercises
Migration4 exercises
Error Handling4 exercises
Best Practices4 exercises
The Exercise
The exercises are a mix of "multiple choice" and "fill in the blanks" questions. There are between 3 and 9 questions in each category. The answer can be found in the corresponding tutorial chapter. If you're stuck, or answer wrong, you can try again or hit the "Show Answer" button to see the correct answer.
If you don't know TypeScript, we suggest that you read our TypeScript Tutorial from scratch.