The TypeScript Guide

By

TypeScript adds types to JavaScript. Start here to learn the language, fix common errors, and go deeper with the complete free course.

~~~

TypeScript is JavaScript with types. You write code that looks almost identical to JavaScript, but the compiler catches a whole class of bugs before your code even runs.

It’s everywhere now. Most popular libraries ship with type definitions, and most new projects start with TypeScript by default.

This page is your starting point for TypeScript on this site. I keep it updated with the best resources I have on the topic.

Where to start

Start here to get the fundamentals down:

  1. TypeScript type for a string or array of strings shows you union types, one of the features you’ll use every day
  2. Object destructuring with types in TypeScript covers a syntax that trips up almost everyone coming from JavaScript
  3. Zod: Type-Safe Schema Validation for TypeScript is what you reach for when data comes from outside your code, like an API or a form

Fixing common problems

Compiler errors are part of daily TypeScript life. This one comes up all the time:

Go deeper

The posts above cover specific problems. If you want a structured path through types, generics, narrowing, and everything in between, take the free TypeScript Course.

You can browse everything I wrote about TypeScript in the typescript tag.

~~~

Related posts about typescript: