0% completed
Course Overview
On This Page
Who Should Take This Course?
How the Course Teaches
Course Structure
What You Will Learn
Grokking TypeScript teaches you how to add a type system to the JavaScript you already write. You describe what each value should be, and the compiler then checks your code against that description before the program runs. The course starts with basic data types and type annotations, and it moves on to generics, advanced types, asynchronous code, modules, and React.
By the end, you will be able to read and write TypeScript for both small and large projects. You will also know what the compiler checks and what it leaves unchecked.
Who Should Take This Course?
The course assumes that you already know JavaScript. It does not assume that you have used TypeScript or any other typed language. Three groups of developers will find it most useful:
- JavaScript developers who want type safety and better editor support in the code they write every day.
- Developers new to TypeScript who want to move from JavaScript to TypeScript one step at a time.
- Full-stack developers who want to use one type system for both back-end and front-end applications.
Experienced TypeScript users can go straight to the chapters on generics and advanced types. The chapter on React assumes that you know React basics, such as components, props, and hooks.
How the Course Teaches
Each lesson explains one topic in plain language and builds on the lessons before it. Most lessons show TypeScript code, then show what the compiler reports or infers from that code, and then explain why. You will learn the most if you type the examples and compile them yourself.
Every chapter ends with an assessment, so that you can test your understanding before you continue. Each attempt draws a set of questions from a larger pool, so a second attempt gives you different questions, and every option comes with an explanation. The course also covers recommended practices and common mistakes, which will help you to write code that stays easy to change.
Course Structure
The course has eleven chapters after this introduction:
- Introduction to TypeScript: Why TypeScript exists, what it gives you and what it costs, and how it compares with JavaScript.
- TypeScript Fundamentals: Static typing, type annotations and type inference, variables and data types, unions, literal types, enums, type aliases, and intersections.
- TypeScript Functions: Function types, call signatures, optional, default, and rest parameters, arrow functions, and function overloading.
- Object Types and Interfaces: Object types, interfaces, and the differences between type aliases and interfaces.
- Classes and Object-Oriented Programming: Classes and properties, static members, inheritance, access modifiers, readonly properties, getters and setters, classes that implement interfaces, and abstract classes.
- Generics: Generic functions, classes, interfaces, and type aliases, generic constraints, and the generic types built into TypeScript.
- Advanced Types: Type assertions, type guards, conditional types, mapped types, template literal types, recursive types, and utility types.
- Asynchronous Programming: Asynchronous functions, promises, async/await, fetching data with Fetch and Axios, and defining types for API responses.
- Modules and Namespaces: TypeScript modules, named and default exports, re-exports and index files, and legacy namespaces.
- TypeScript with React: How TypeScript works with React and JSX, how to set up a project, how to type components and props, and how to use TypeScript with React hooks.
- Performance Optimization and Best Practices: How to reduce compile time in large applications, how to enforce strict mode, and how to avoid common mistakes.
What You Will Learn
By the end of this course, you will be able to:
- Explain how the TypeScript type system works and apply it in your own projects.
- Use generics, advanced types, and typed asynchronous code in real applications.
- Organize TypeScript code with modules, and type React components and hooks.
- Recognize the limits of static types, which are removed before the program runs and do not check data at runtime.
- Write code that follows recommended TypeScript practices.
Reading Progress
0%
On This Page
Who Should Take This Course?
How the Course Teaches
Course Structure
What You Will Learn