EN
Fundamentals

What Is TypeScript?

Concepts2 min readUpdated June 12, 2026

In short

TypeScript is JavaScript with an added layer of type checking that catches mistakes before you ever run your code. It is the same language you already write, plus labels that say what kind of value each thing should be, like text, a number or a list. When you mix them up by accident, TypeScript warns you immediately instead of letting the bug surface later for a user. Most modern projects, including this one, use it for exactly that reason.

Types are guardrails

A type is just a promise about what a value is. If a function expects a number and you hand it text, TypeScript flags it as you type, in your editor, before anything runs. That turns a class of frustrating runtime bugs into clear messages you fix in seconds.

function double(n: number) {
  return n * 2
}

double("5") // TypeScript error: a string is not a number
The ": number" label is the type. TypeScript catches the wrong input.

It compiles to JavaScript

Browsers and Node.js do not run TypeScript directly. A build step turns your TypeScript into plain JavaScript, removing the type labels. So TypeScript is purely a tool for you while writing; what actually ships is ordinary JavaScript.

Why it helps when building with AI

When an AI agent edits your code, TypeScript acts as an automatic reviewer. If a change breaks an expected type, the type check fails loudly, which catches mistakes before they reach your users. That fast feedback loop is one reason agent-built projects lean on TypeScript so heavily.

Common beginner confusions

The red squiggly lines under your code can feel like errors that stop everything, but most of the time they are warnings pointing at a real problem you should fix, not a crash. A type error means "this value is not the shape I expected", and the message usually tells you exactly what went wrong. Beginners also worry they must add types everywhere by hand; in practice TypeScript figures out most types on its own, and your agent adds the rest. Finally, do not confuse the type check failing with your app being broken at runtime. The whole point is that TypeScript catches the issue before you run anything, so a failing type check is the system doing its job, not a sign that something is on fire.

Frequently asked questions

Next step

Ready to put AI to work as a real workflow?

Start with the foundations course, keep your progress locally and sync everything to your free account whenever you like.