01

Why TypeScript?

Find out what TypeScript is, why types make bigger projects easier, and how to give your first variables and functions their own types.

3 lessons
  1. 1 What Is TypeScript? JavaScript with a safety net 6 min
  2. 2 The Three Basic Types string, number, and boolean 7 min
  3. 3 Typing Variables and Functions Tell TypeScript what goes in and what comes out 8 min
02

Shaping Your Data

Give types to the arrays and objects that hold your real data, describe object shapes with interfaces, and handle values that might be missing.

3 lessons
  1. 4 Arrays with Types A list where everything belongs 7 min
  2. 5 Objects and Interfaces Describe the shape of your data 9 min
  3. 6 Optional Properties and Defaults When a value might not be there 8 min
03

Flexible Types

Learn union and literal types for values with a few allowed options, let type inference do the boring work, and compare enums with unions.

3 lessons
  1. 7 Union Types and Literal Types This or that, but nothing else 9 min
  2. 8 Type Inference TypeScript often just knows 6 min
  3. 9 Enums vs Unions Two ways to say 'pick from this list' 8 min
04

TypeScript in the Real World

Take a gentle first look at generics, see exactly how TypeScript turns into JavaScript, and learn where it fits when building a real website.

3 lessons
  1. 10 A Gentle Look at Generics One function, many types 10 min
  2. 11 How TypeScript Becomes JavaScript The compile step, demystified 7 min
  3. 12 Where TypeScript Fits in a Website Your map of the real world 6 min