inflearn logo

TypeScript for Free: From Basics to Type Design

After studying JavaScript, starting TypeScript often leads to getting stuck on the question, "Why should I use these types?" rather than the new syntax itself. This course covers everything from basic types to unions, type narrowing, generics, keyof, Pick, and Omit in a connected learning path. Additionally, practice problems are provided as separate missions so you can directly apply what you've learned. After completing the course, you will be able to understand the causes of type errors instead of blindly hiding them, safely reduce repetitive types, and express the intent of your code through types.

17 learners are taking this course

Level Basic

Course period Unlimited

TypeScript
TypeScript
TypeScript
TypeScript

What you will gain after the course

  • Instead of hiding errors with any or type assertions, you can find the difference between the expected type and the actual type to correct it properly.

  • You can express the intent of your code and its allowable states as types by utilizing objects, functions, unions, and interfaces.

  • By utilizing generics and constraints, you can reduce code duplication while maintaining specific types for inputs and outputs.

  • You can safely extract and transform the types you need from existing types using keyof, typeof, Pick, Omit, Partial, Record, and more.

Most TypeScript learning stops at "erasing" errors. You feel finished once the red lines disappear. However, code asserted with as and covered with any will still explode at runtime.

This lecture presents the same code in two different ways side-by-side, distinguishing what is truly safe in every chapter.

  • Code that hides errors: const user = data as User -> It passes compilation, but if the server provides a different structure, it explodes at runtime.

  • Code that resolves errors: External data is received as unknown and only becomes a domain type after passing validation.


What you can do after completion

  1. Identify the exact point where a type relationship first goes wrong within a long TypeScript error message.

  2. Safely handle external data using unknown and type narrowing instead of any. để xử lý dữ liệu bên ngoài một cách an toàn.

  3. Model the types of objects and functions according to their purpose, and design them so that invalid states are unrepresentable.

  4. Safely reduce repetitive types using generics, keyof, and utility types.

  5. Catch missing branches at the compilation stage using discriminated unions and never checks.

  6. Understand the difference between as and satisfies, and choose validation over bypass., đồng thời lựa chọn việc xác thực thay vì bỏ qua.


Curriculum (6 Parts · Chapters 1~14)

Part 1. Getting Started with TypeScript

  • Ch 1. The Limitations of JavaScript and the Birth of TypeScript

  • Ch 2. Compilation Process, Development Environment, tsconfig.json

Part 2. Mastering Basic Types

  • Ch 3. Type Inference, Type Annotations, Primitive Types, and Literal Types

  • Ch 4. Array, Tuple, and Object Types

  • Ch 5. Type Aliases, Interfaces, and Special Types

Part 3. Type Combinations and Relationships

  • Ch 6. Union and Intersection

  • Ch 7. Type Narrowing and Discriminated Unions

  • Ch 8. Type Assertions, satisfies, Structural Typing and Compatibility

Part 4. Functions and Object-Oriented Programming

  • Ch 9. Function Types, Parameters, and Overloading

  • Ch 10. Classes, Access Modifiers, Abstract Classes, and Interfaces

Part 5. Generics

  • Ch 11. Generic Functions, Types, Interfaces, and Classes

  • Ch 12. Generic Constraints and Reusable Type Design

Part 6. Type Programming

  • Ch 13. keyof, typeof, Indexed Access Types

  • Ch 14. Utility Types and Practical Type Transformation


Recommended for these people

  • Those who have completed beginner, intermediate, and advanced JavaScript courses

  • Those who feel they are only clearing errors using as or any

  • Those who have been burned at runtime after using type assertions for API responses

  • Those who want to use generics and utility types with a true "understanding" of them

  • Those who want to know even the decision-making criteria for why it is used that way

Recommended for
these people

Who is this course right for?

  • Those who know JavaScript but feel overwhelmed about where to start with TypeScript

  • Those who are resolving TypeScript errors using 'any' and type assertions

  • Those who have studied TypeScript syntax but can't think of how to use it in practice

  • Those who want to build a solid foundation in types before learning React or frontend frameworks

Need to know before starting?

  • JavaScript basic syntax (you must know the basic usage of variables, conditional statements, loops, functions, arrays, and objects.)

Hello
This is potatosam

Career Verified

71

Learners

3

Reviews

2

Answers

5.0

Rating

5

Courses

Hello, I'm Potato-ssam, a frontend developer with 4 years of experience.

Currently, I am developing a global mobility service. I have gained practical experience by building multilingual services and am also a global Top 30 contributor to the open-source library react-hook-form, which is used by developers worldwide.

But I wasn't always like this from the start.

When I first learned JS, I felt like I understood everything while following along with YouTube tutorials, but I countless times experienced my mind going blank the moment I opened an empty editor. At first, I was just busy copying and pasting code I found through Googling, and when an error occurred, I didn't know where to start, leading to many frustrated nights spent staying up for days.

I struggled a lot during that process. I wrote code without even knowing what the DOM was, and I wasted hours not understanding why an event was firing twice. What I needed most back then wasn't memorizing vast amounts of grammar. It was someone who could explain "why this code actually works."

I created this course by organizing everything I've built up over four years of practical experience, along with the areas where I struggled the most as a beginner. You don't have to take the long way around like I did. I've already been through it for you.

More

Reviews

Not enough reviews.
Please write a valuable review that helps everyone!

potatosam's other courses

Check out other courses by the instructor!

Similar courses

Explore other courses in the same field!

Free