TypeScript exercises
The goal: Let everyone play with many different TypeScript features and get an overview of TypeScript capabilities and principles.
Things to cover
- Basic typing.
- Refining types.
- Union types.
- Merged types.
- Generics.
- Type declarations.
- Module augmentation.
- Advanced type mapping.
Rules and principles
-
Avoid using
any
type at all costs. -
Difficulty quickly grows one exercise after another.
-
Don't open next exercises before finishing previous ones. Next exercises may contain spoilers and will prevent you from enjoying the delightful process of TypeScript debugging.
-
Feel free to send a pull-request with your solutions if you need some additional feedback.
-
Provide feedback to the creator of these exercises.
-
Enjoy.
Installation and usage
-
Make sure you have
node.js
(andyarn
if you prefer it overnpm
) installed on your machine. -
Start by opening
exercises/exercise-00/index.ts
. -
Once done with the exercise, proceed to the next one.