This repository contains a collection of TypeScript examples and notes covering fundamental concepts of the language. Each file focuses on specific TypeScript features with practical examples.
-
- Function expressions, declarations, and arrow functions
- Optional and default parameters
- Rest parameters
- Function types
-
- Interface definitions and usage
- Class declarations with access modifiers
- Class implementation of interfaces
- Constructor parameter properties
-
- Union types (
|) - Intersection types (
&) - Type guards and narrowing
- Complex type combinations
- Union types (
-
Type Aliases and Type Assertions
- Creating type aliases
- Complex type definitions
- Type assertions using
asand angle brackets
-
- Special TypeScript types
- Type safety considerations
- Make sure you have Node.js installed
- Install TypeScript globally:
npm install -g typescript
- Clone this repository
- Use
tscto compile the TypeScript files or run them directly withts-node