TypeScript for JavaScript developers: types that help

Go from plain JavaScript to confident TypeScript: inference, unions, narrowing, generics, utility types and a strict project setup

7 ratings 2,750 students Sample

Created by Tomas Lindqvist

  • Updated September 2026
  • English
  • Intermediate

What you will learn

  • Explain what TypeScript checks at compile time and what remains at runtime
  • Model data accurately with object types, unions and literal types
  • Narrow types safely with typeof, in, discriminated unions and type guards
  • Write generic functions and types that stay readable
  • Use utility types to derive types instead of repeating them
  • Configure a strict project and migrate JavaScript code incrementally

Course content

6 sections, 25 lessons, 4h 15m total

Thinking in types 5 lessons · 49 min
  • Video: What TypeScript is and is not Preview 8 min
  • Article: Inference and annotations Preview 11 min
  • Article: Object types, unions and literal types 13 min
  • Article: Narrowing: how TypeScript follows your checks 12 min
  • Quiz: Check your understanding 5 min
Functions and generics 4 lessons · 44 min
  • Video: Typing functions and callbacks 11 min
  • Video: Generics from first principles 14 min
  • Video: Constraints and default type parameters 11 min
  • Article: Overloads and when to avoid them 8 min
Deriving types instead of repeating them 4 lessons · 44 min
  • Video: Utility types you will use often 12 min
  • Video: keyof, typeof and indexed access 11 min
  • Video: Mapped and conditional types in practice 13 min
  • Article: The satisfies operator 8 min
Types at the edges of your app 4 lessons · 44 min
  • Video: Typing API responses honestly 11 min
  • Video: Runtime validation with Zod 13 min
  • Video: Typing the DOM and events 10 min
  • Video: Typing Node.js code 10 min
Project setup and migration 4 lessons · 44 min
  • Video: A strict tsconfig explained 12 min
  • Article: Type checking in CI and editors 8 min
  • Video: Migrating JavaScript step by step 15 min
  • Video: Types for third party libraries 9 min
Patterns for real projects 4 lessons · 30 min
  • Article: Branded types for IDs 9 min
  • Video: Error handling with result types 10 min
  • Article: Wrapping up and next steps 6 min
  • Quiz: Final check 5 min

Requirements

  • Solid modern JavaScript: functions, objects, arrays, modules and promises
  • Node.js 20 or newer

Description

TypeScript adds a type system on top of JavaScript. It catches mistakes while you type, makes editors smarter and turns large codebases from scary into manageable. Most new JavaScript projects at companies of every size now start in TypeScript, and many libraries ship their own types.

Many developers learn TypeScript by fighting the compiler until the red lines go away. This course takes a different route. We focus on how the type system thinks, so you write types that describe your data accurately and let inference do most of the work.

What we cover

  • How TypeScript checks code and what it removes at runtime
  • Inference, annotations and when to write each
  • Object types, unions, literal types and narrowing
  • Functions, overloads and typing callbacks
  • Generics without fear
  • Utility types, mapped types and conditional types, at a practical level
  • Typing API responses and validating them at runtime
  • A strict tsconfig, project structure and migrating a JavaScript codebase

How it is taught

Lessons are short and code heavy. Each one has small exercises you complete in the TypeScript playground or the course repository, with failing type checks you need to fix. In the final section we migrate a real looking JavaScript project to TypeScript one file at a time.

You should be comfortable with modern JavaScript, including arrow functions, destructuring, modules and promises.

Who this course is for

  • JavaScript developers starting with TypeScript
  • Developers who use TypeScript but mostly fight the compiler
  • Teams planning to migrate a JavaScript codebase

Instructor

Tomas Lindqvist

JavaScript and TypeScript teacher focused on fundamentals that last longer than frameworks

  • 4.5 instructor rating
  • 22 reviews
  • 10,782 students
  • 3 courses
  • Sample

I have written JavaScript for browsers and servers for a long time, and I still think the language itself is the best investment a web developer can make. Frameworks change every few years. Closures, the event loop and a good type system do not.

I teach in small steps with lots of short exercises. Every lesson ends with something you can run in the browser console or in Node, so you never have to take my word for it.

When I am not recording, I maintain internal tooling and libraries written in TypeScript, and I spend more time than I should reading the ECMAScript proposals list.

View profile

Student reviews

4.4 7 ratings
5 star 57%
4 star 29%
3 star 14%
2 star 0%
1 star 0%
Amina Y. Oct 1, 2026
Sample

Zod lesson tied it together

Validating at the edges and inferring types from schemas is now how our team handles every API call.

Oliver J. Sep 20, 2026
Sample

Stopped fighting the compiler

Learning to hover and read inferred types changed everything. I write fewer annotations now and get better errors.

Fatima B. Aug 20, 2026
Sample

Discriminated unions are a game changer

Modelling loading states as unions removed a whole category of bugs in our React app.

Mikael S. Jul 16, 2026
Sample

Clear generics section

Generics finally make sense. The mapped types lesson is dense, but that is the nature of the topic.

Chen Y. Jun 9, 2026
Sample

Migration lesson was exactly our case

We are migrating a large JavaScript codebase. The allowJs and checkJs approach worked well for us.

Beatriz L. Apr 16, 2026
Sample

Great balance of theory and practice

Exercises with failing type checks were fun. A few more Node.js examples would help.

Gary W. Feb 14, 2026
Sample

Pace is uneven

The first sections are easy, then conditional types arrive quickly. Still worth it for the narrowing lessons.

$49.99 Enroll now
SampleSample catalog: the instructors, courses, reviews and stats on this site are demo content.