1. Static Typing

TypeScript lets you declare types for variables, function parameters, and return values.

let count: number = 0;

function add(a: number, b: number): number {
  return a + b;
}

Why it matters:


2. Type Inference

You often don’t need to write types—TypeScript can infer them.

const name = "Saima"; // inferred as string

function multiply(x: number, y: number) {
  return x * y; // inferred return type: number
}

Why it matters:


3. Interfaces and Type Aliases

Describe the shape of objects.

interface User {
  id: string;
  email: string;
}

type Status = "idle" | "loading" | "error";

Why it matters: