TypeScript

JavaScript with a type checker in front of it.

TypeScript is taught here in 13 lessons, running from Basic types and inference through to Real-world modelling: errors, API and state. Each lesson takes one topic, shows the working code, and links onward to the next, so the course can be read straight through in order.

TrackFront-end Development
Lessons13
LevelBeginner to intermediate
Reading timeabout 3 hours
PrerequisitesHelpful, but not required: JavaScript

Lessons

  1. Basic types and inferenceThe primitives, arrays, unions and the inference rules that mean you annotate far less than you expect.
  2. Interfaces, type aliases and genericsWhen to use an interface rather than a type alias, how structural typing behaves, and what generics actually buy you.
  3. tsconfig and toolingThe compiler options that matter, why a fast bundler proves nothing about correctness, and how to wire checking into a build.
  4. Narrowing, unions and exhaustive checksDiscriminated unions, built-in and user-defined guards, the satisfies operator, and using never to prove you handled every case.
  5. Typing functions, callbacks and thisParameters, optional and rest arguments, overloads that model real call shapes, contextual typing for callbacks, and the this parameter.
  6. Utility types, keyof and mapped typesThe built-in transforms you will actually use, keyof and indexed access, mapped type modifiers, and template literal types for derived APIs.
  7. Classes, modifiers and abstract typesAccess modifiers and parameter properties, runtime-private fields, implements versus extends, abstract members, and the static side of a class.
  8. Generic patterns without over-engineeringConstraints and defaults, where type inference actually looks, generic data structures, and the judgement to stop generalising.
  9. Typing asynchronous and external dataPromises and Awaited, typed fetch results, AbortSignal, and modelling failure as a value instead of hoping nothing rejects.
  10. Runtime validation at the edgesWhy types vanish at runtime, deriving the static type from one schema, and parsing API responses, forms and environment variables.
  11. Declaration files and third-party typesWriting .d.ts declarations, using @types packages, typing an untyped dependency locally, and publishing types with your own package.
  12. Migrating a JavaScript project incrementallyallowJs and checkJs, turning strict flags on one at a time, JSDoc as a stepping stone, and keeping the debt visible in CI.
  13. Real-world modelling: errors, API and stateError and result types, API envelopes, loading state as a union, branded ids and state machines that make invalid transitions unwritable.

More in Front-end Development

HTML CSS JavaScript HTML DOM AJAX JSON Tailwind CSS Bootstrap 5 Foundation Vue.js React Next.js Angular jQuery ECharts Chart.js SVG Font Awesome

FAQ

How long does the TypeScript course take?
It has 13 lessons, about 3 hours of reading. Expect roughly twice that if you type out and run every example.
Do I need prior experience for TypeScript?
Not strictly. It helps to have read JavaScript first, because some lessons build on it, but every lesson explains its own assumptions.
What should I read after TypeScript?
Continue with HTML DOM (13 lessons), the next course in Front-end Development.