TypeScript for JavaScript Developers
Learning Path ⋅ Skills: Type Annotations, Type Inference, Union Types, Narrowing, Runtime Validation, Async Types, Generics, Utility Types, tsconfig, Migrating JavaScript to TypeScript
This learning path is for you if you already write modern JavaScript with modules, npm, and the DOM, but have never used a statically typed language. You’ll need Node, a terminal, and an editor with TypeScript support, and you’ll check your code in strict mode from the start.
You’ll start by letting the checker read JavaScript you already write, then model data with unions so impossible states can’t be written. Next, you’ll check data from files and APIs before you trust it and write reusable types with generics. Last, you’ll migrate a real Vite project to strict TypeScript.
Each course tells its own story, with exercises in the browser that test your code, a project, and a quiz. Throughout, you’ll treat the checker as a reviewer, for code an AI assistant wrote too. The path ends with a program you build from a brief without a walkthrough.
TypeScript for JavaScript Developers
Learning Path ⋅ 1 Resource
Is this path right for you? Mentor AI knows what’s in it and can help you decide where to begin.
Check JavaScript Before It Runs
Start by adding TypeScript to JavaScript you already write. You’ll set up a Node project that checks your code with npm run check, annotate where inference needs help, and trace type errors back to their cause. Then you’ll fix the wrong quotes in a bike shop’s calculator.
Model Data So Wrong States Can't Exist
With annotations in place, you’ll make your types carry the rules. You’ll model data with unions and literal types, narrow a union before you read it, and handle missing values on purpose. Then you’ll rebuild a ferry’s departures board so a canceled crossing can’t show as boarding.
Check Data From Outside Your Program
Your types can’t vouch for data that comes from a file or an API. Here, you’ll treat it as unknown, check it once at the boundary with type guards or a schema, and type async code. You’ll also learn to tell a justified type assertion from one that hides a bug.
Write Types Once and Derive the Rest
Once a project spans several scripts, copied types drift apart. You’ll type classes and modules, write generic functions, and derive types with keyof, typeof, and utility types. Then you’ll build one typed API client that a kids’ football league’s scripts can share.
Move a Real Project to Strict TypeScript
Finally, you’ll bring it all to a real Vite project. You’ll configure tsconfig.json, migrate a theater’s ticketing pages to strict TypeScript one module at a time, and check them with tsc and typescript-eslint. Then you’ll type a season-pass system from a brief, without a walkthrough.
Test Your Knowledge
You’ve made it through the whole path! In the wrap-up quiz below, you’ll revisit annotations and inference, unions and narrowing, checking outside data, generics and derived types, and migrating a project to strict TypeScript. Use it to spot any topics that still feel shaky.
Interactive Quiz
TypeScript for JavaScript Developers
Check what you've learned about TypeScript, from inference and unions to checking outside data, generics, and a strict migration.
Congratulations on completing this learning path! You can now add types to the JavaScript you write, model data with unions so wrong states can’t be written, and check data from outside your program before you trust it.
You can also write generic functions, derive types from one source, migrate a JavaScript project to strict TypeScript in working steps, and find where types lie in code someone else wrote.
You might also be interested in these related learning paths:
Got feedback on this learning path?
Looking for real-time conversation? Visit the RealJS Community Chat or join the next “Office Hours” Live Q&A Session. Happy coding!