TypeScript Foundation
JavaScript with a type system that catches your mistakes before your users do.
JavaScript will happily let you call a function with the wrong arguments, misspell a property, and pass a string where a number belongs. It tells you at runtime, in production, in front of a user.
TypeScript is JavaScript with a type checker attached. You write nearly the same code, and an entire category of bug becomes impossible to ship.
This course is practical rather than academic. It covers the type system you will genuinely use every day and deliberately stops short of the type-level cleverness that makes some TypeScript codebases unreadable.
You finish able to work confidently in any TypeScript codebase — which, increasingly, is all of them. It is also a hard prerequisite for the Full-Stack Web Development course, where both halves of the stack are written in it.
Who this is for
- JavaScript developers who keep hitting avoidable runtime errors
- Anyone heading into React, Next.js, Node or NestJS work
- Developers joining a team whose codebase is already TypeScript
- Anyone taking the Full-Stack Web Development course, where this is required
What you need first
- Comfortable JavaScript: functions, objects, arrays, promises and modules.
- Our JavaScript Complete Foundation course covers everything assumed here.
Tools you will use
By the end you can
- Read and write typed JavaScript without fighting the compiler
- Model data with interfaces, type aliases and unions
- Use generics to write reusable code that keeps its types
- Narrow types properly instead of reaching for any
- Configure tsconfig deliberately rather than copying somebody else's
- Add TypeScript to an existing JavaScript project one file at a time
- Type an API response you do not control
- Judge when a precise type is worth the effort and when it is not
9 modules, 40 lessons
Work through these in order. Each lesson is short enough to finish in one sitting and ends with something to build, not a quiz.
- 1
Why TypeScript
The problem it solves, shown with the bugs it prevents.
- The bugs TypeScript exists to preventComing soon
- How type checking works, and what it cannot doComing soon
- What TypeScript is not: runtime, performance and other mythsComing soon
- Setting up a TypeScript project from scratchComing soon
- 2
The Basic Types
Everything you will use in your first week.
- string, number, boolean and the restComing soon
- Arrays and tuplesComing soon
- any, unknown and neverComing soon
- Inference: when to annotate and when to stopComing soon
- Literal types and as constComing soon
- 3
Objects, Interfaces and Type Aliases
Describing the shape of your data.
- Typing objectsComing soon
- InterfacesComing soon
- Type aliases, and interface versus typeComing soon
- Optional and readonly propertiesComing soon
- Nested and recursive structuresComing soon
- 4
Functions
Parameters, return types, and the overloads you rarely actually need.
- Typing parameters and return valuesComing soon
- Optional, default and rest parametersComing soon
- Function types and callbacksComing soon
- Overloads, and why you usually want a union insteadComing soon
- 5
Unions and Narrowing
The part of TypeScript that makes it genuinely powerful rather than merely annoying.
- Union typesComing soon
- Narrowing with typeof, in and truthinessComing soon
- Discriminated unions, the best pattern in the languageComing soon
- Writing your own type guardsComing soon
- Exhaustiveness checking with neverComing soon
- 6
Generics
Reusable code that does not throw its types away.
- Why generics exist, starting from duplicationComing soon
- Generic functionsComing soon
- Constraining a generic with extendsComing soon
- Generic interfaces and classesComing soon
- Built-in utility types: Partial, Pick, Omit and RecordComing soon
- 7
Classes, Modules and Decorators
The object-oriented side, including the decorators NestJS is built on.
- Classes and access modifiersComing soon
- Abstract classes and implementing interfacesComing soon
- Modules, imports and exportsComing soon
- Decorators: what they are, ahead of NestJSComing soon
- 8
TypeScript in Real Projects
Config, third-party libraries, and code that was not written in TypeScript.
- tsconfig explained, option by optionComing soon
- Strict mode, and why to turn it on from day oneComing soon
- Types for third-party libraries and DefinitelyTypedComing soon
- Adding TypeScript to an existing JavaScript projectComing soon
- Typing API responses you do not controlComing soon
- 9
Practice Project
Build something typed from end to end, then fix one that is not.
- The brief: a typed API clientComing soon
- Building itComing soon
- Refactoring an any-heavy codebaseComing soon
Learning this with a mentor is faster
Our internship programme is free and fully remote. You get this curriculum, real project work, and code review from working developers.