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.
| Track | Front-end Development |
| Lessons | 13 |
| Level | Beginner to intermediate |
| Reading time | about 3 hours |
| Prerequisites | Helpful, but not required: JavaScript |
Lessons
- Basic types and inferenceThe primitives, arrays, unions and the inference rules that mean you annotate far less than you expect.
- Interfaces, type aliases and genericsWhen to use an interface rather than a type alias, how structural typing behaves, and what generics actually buy you.
- tsconfig and toolingThe compiler options that matter, why a fast bundler proves nothing about correctness, and how to wire checking into a build.
- Narrowing, unions and exhaustive checksDiscriminated unions, built-in and user-defined guards, the satisfies operator, and using never to prove you handled every case.
- Typing functions, callbacks and thisParameters, optional and rest arguments, overloads that model real call shapes, contextual typing for callbacks, and the this parameter.
- 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.
- Classes, modifiers and abstract typesAccess modifiers and parameter properties, runtime-private fields, implements versus extends, abstract members, and the static side of a class.
- Generic patterns without over-engineeringConstraints and defaults, where type inference actually looks, generic data structures, and the judgement to stop generalising.
- Typing asynchronous and external dataPromises and Awaited, typed fetch results, AbortSignal, and modelling failure as a value instead of hoping nothing rejects.
- Runtime validation at the edgesWhy types vanish at runtime, deriving the static type from one schema, and parsing API responses, forms and environment variables.
- Declaration files and third-party typesWriting .d.ts declarations, using @types packages, typing an untyped dependency locally, and publishing types with your own package.
- 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.
- 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.