This repository contains the solution for the Level 2 Batch 7 Assignment 1.
├── solutions.ts # All 7 TypeScript problem solutions
├── blog-1.md # Blog: any vs unknown & Type Narrowing
├── blog-2.md # Blog: Generics in TypeScript
└── README.md
| # | Function | Description |
|---|---|---|
| 1 | filterEvenNumbers |
Filters even numbers from an array |
| 2 | reverseString |
Reverses a string |
| 3 | checkType |
Type guard for string or number |
| 4 | getProperty |
Generic property accessor with key constraint |
| 5 | toggleReadStatus |
Adds isRead property to a Book object |
| 6 | Student class |
Inherits from Person, adds grade & getDetails |
| 7 | getIntersection |
Returns common elements of two arrays |
- blog-1.md — Why
anyis unsafe andunknownwith type narrowing is the correct approach - blog-2.md — How Generics enable reusable, strictly-typed components and functions