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 thorough. It covers not only the types you use every day but the advanced type system TypeScript is actually chosen for — mapped and conditional types, infer, template literals — taught with the judgement of when they earn their place and when they make a codebase unreadable. It also covers the asynchronous code most real TypeScript is, which too many courses skip.
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
- Use the advanced type system — mapped and conditional types, infer, template literals — where it genuinely helps
- Type asynchronous code: promises, async/await and the concurrency operators
- Model your domain so illegal states cannot be represented
- Write, harden and test a typed library end to end
- Judge when a precise type is worth the effort and when it is not
Stuck? Compare your work
weather-client — the typed weather client the capstone builds end to end: given a latitude and longitude it returns a fully-typed Weather value from the live Open-Meteo API, validating untrusted JSON at the boundary and modelling every failure as a typed Result. It exercises the whole course — discriminated unions, narrowing, generics, unknown and type guards, async, dependency injection, and type-level tests — and is verified (tsc clean, 8 runtime tests, a live API call).
It is there for when you are stuck, not to start from. Type the code yourself first — copying it will teach you very little.
14 modules, 68 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.
- 2
The Basic Types
Everything you will use in your first week.
- 3
Objects, Interfaces and Type Aliases
Describing the shape of your data.
- 4
Functions
Parameters, return types, and the overloads you rarely actually need.
- 5
Unions and Narrowing
The part of TypeScript that makes it genuinely powerful rather than merely annoying.
- 6
Generics
Reusable code that does not throw its types away.
- 7
The Type System in Depth
The type-level features TypeScript is actually chosen for — and the judgement to use them where they help, not to show off.
- 8
Asynchronous TypeScript
Typing the asynchronous code that most real TypeScript is — promises, async/await, and the concurrency operators.
- 9
Data Structures, Typed
Typing the collections you use every day, and keeping them immutable — with the costs that decide which to reach for.
- 10
Classes, Modules and Decorators
The object-oriented side, including the decorators NestJS is built on.
- 11
Writing TypeScript Worth Reading
The difference between code that compiles and code worth hiring: unknown over any, honest types, error handling and review.
- 12
Design Patterns in TypeScript
Which patterns the type system dissolves, which few earn their place, and when a pattern is over-engineering.
- 13
TypeScript in Real Projects
Config, declaration files, third-party libraries, and code that was not written in TypeScript.
- tsconfig explained, option by option30 min
- Strict mode, and why to turn it on from day one25 min
- Declaration files: .d.ts, ambient types and module augmentation30 min
- Types for third-party libraries and DefinitelyTyped25 min
- Adding TypeScript to an existing JavaScript project30 min
- Typing API responses you do not control30 min
- 14
Capstone: A Typed Library and Client
Design, build, harden and test a real typed TypeScript package end to end — the shape of the work you will be handed.
Learning this with a mentor is faster
Going through a course like this one is how you qualify for our six-month internship, for selected students, mostly from Pune. Clear the interview and you build real-world projects with my mentorship.