A collection of TypeScript exercises including adding type safety‚ building data structures‚ and solving problems using TypeScript․ In this repository‚ I document my learning from basic to advanced type annotations and problem-solving examples․
- Type annotations
- Arrays
- Tuples
- Objects
- Optional properties
- Union types
- Function typing
- unknown and type narrowing
- Interfaces
- Type aliases
- Generics
- Generic constraints
- Type assertions
- Enums
- Literal types
- as const
- Utility types like Partial‚ Pick and Omit
- Typed data models
- Note: Arrays and objects
- map‚ filter‚ find‚ and reduce
- Union types in practical situations
- Discriminated unions
- Typed function returns
- Working with nested data
- TypeScript with added JavaScript logic
The exercises are divided into four sections according to how I learned them:
- 01-fundamentals
- 02-type-system
- 03-problem-solving-01
- 04-problem-solving-02
The most useful part of this practice was to learn that TypeScript is not just adding types to JavaScript․ It also helps me think more clearly about what sort of shape data will be‚ what a function should accept‚ and what it should return․