Sikau

Learn TypeScript

JavaScript with types that catch mistakes as you type.

For learners who know JavaScript. Add types to your code and let the TypeScript compiler find bugs before anyone runs it — from basic annotations to unions, generics and typing real apps. Your code is type-checked live, in strict mode.

Intermediate · 24 lessons · about 10 hours · free

Start TypeScript free: run real code in your browserright here

Continue with Google

What you will learn

Unit 1: TypeScript basics

Types, inference, arrays, functions and object shapes.

  1. Day 1Why TypeScript?Catch mistakes before you run your code.20 min
  2. Day 2Basic types and inferencestring, number, boolean — and letting TypeScript guess.20 min
  3. Day 3any and unknownEscape hatches, and the safe one.20 min
  4. Day 4Arrays and tuplesLists of one type, and fixed-length pairs.20 min
  5. Day 5Typing functionsParameters, return types, optional and callbacks.25 min
  6. Day 6Object typestype aliases and interfaces.25 min
  7. Day 7Project: Typed shopping cartInterfaces and functions working together.30 min

Unit 2: Unions and narrowing

Values that can be one of several things, handled safely.

  1. Day 8Union typesThis or that.20 min
  2. Day 9NarrowingChecks that teach TypeScript what you know.25 min
  3. Day 10Literal typesExact values as types, and as const.20 min
  4. Day 11Discriminated unionsModel each case with its own data.30 min
  5. Day 12Null safetyStrict null checks, ?. and !.25 min
  6. Day 13Project: Order trackerUnions and narrowing in a real model.35 min

Unit 3: Generics and type tools

Reusable types, constraints, utility types and types from values.

  1. Day 14Generic functionsOne function, any type — still checked.25 min
  2. Day 15Generic constraintsextends and keyof.25 min
  3. Day 16Generic typesBoxes, results and reusable shapes.25 min
  4. Day 17Utility typesPartial, Pick, Omit, Record, Readonly.25 min
  5. Day 18Types from valuestypeof, ReturnType and satisfies.25 min
  6. Day 19Project: Typed event busGenerics that guard every event.35 min

Unit 4: TypeScript in practice

Classes, async data, the DOM, modules and a typed capstone.

  1. Day 20Classes in TypeScriptAccess modifiers and implements.25 min
  2. Day 21Typing async codePromise<T> and checking data from the internet.30 min
  3. Day 22Typing the DOMElements, null checks and events.30 min
  4. Day 23Modules and declaration filesHow TypeScript fits into real projects.25 min
  5. Day 24Capstone: Typed state machineDiscriminated unions, generics and reducers together.40 min

Before you start

These courses make TypeScript easier:

See all courses

Built with ❤️ by dibe.sh