Connecting
Learn/L4 · TypeScript

What is TypeScript?

TypeScript is JavaScript with a shape-checker bolted on, so wrong pieces never fit.

Difficulty 3/5

Mental model

+ typesJavaScript (loose)TypeScript (checked)

Plain English

TypeScript adds labels to your code that say 'this value must be a string', 'this object must have these fields'. Before the app runs, a checker confirms everything fits. Most bugs caught by TypeScript are 'you passed the wrong shape'.

Analogy

JavaScript is IKEA furniture with no labels. TypeScript adds the part numbers so you can't put a leg in a screw hole.

Jessica's wedding portal

type Task = { title: string; dueDate: string; weddingId: string }. If you forget dueDate when calling createTask, TypeScript yells before the app runs.

Agentify CRM

type Conversation = { id: string; channel: 'whatsapp' | 'instagram' | 'email' }. Any other channel is rejected.

Go deeper

JavaScript with a part-number checker.

Common mistakes

  • Using 'any' everywhere to silence the checker. That defeats the point.
  • Trusting types alone — TS doesn't catch logic bugs, only shape bugs.

AI-agent trap

Agents reach for 'any' or '// @ts-ignore' to make errors disappear. Force them to fix the type.
Quick check
When does TypeScript catch errors?

Summary

You write types alongside your code. The compiler checks them at build time. If a function expects { title: string } and you pass { title: 123 }, you get an error before you run.

Confidence: