TypeScript

JavaScript with a spellchecker.

▶ the lesson · ~35s · narrated · tap for sound

the intro

TypeScript is JavaScript with types. You describe the shape of your data once, and the compiler catches mistakes before the code runs — plus your editor gains autocomplete that actually knows your code. It compiles to plain JavaScript and has become the default for serious frontend work.

the sample

types catch bugs before runtime

type User = {
  name: string
  age: number
}

const u: User = { name: "Ericko", age: "oops" }
//        ~~~~ error: string is not number

fun fact ✦

TypeScript is written in TypeScript — the compiler compiles itself.

the docs

quick hits about TypeScript

15-second answers · interviews, tips, trivia & hidden gems

🎤 interview

Interface or type?

🎤 interview

Any vs unknown?

🎤 interview

Enums or union types?

📚 tutorial

What is a generic?

🔧 useful

Rewriting types by hand?

💎 deep

What does satisfies do?

🔧 useful

Type everything?

🧠 trivia

What is TypeScript written in?