AI Workshop: learn to build apps with AI →
TypeScript: The editor helps you with type errors

Join the AI Workshop and learn to build real-world apps with AI. A hands-on, practical program to level up your skills.


If you pass a string to multiply(), VS Code will show you an error by underlining the problematic part of your code:

Hover over it with the mouse, and VS Code will tell you more:

Now, regarding TypeScript errors, sometimes they are a bit cryptic. Not in this case. But there is a VS Code extension that helps you by giving actionable information, and it’s called Pretty TypeScript Errors.

Install that, you’ll see different error messages:

This is what happens in the editor.

Lessons in this unit:

0: Introduction
1: Your first TypeScript program
2: Types
3: Typing functions
4: ▶︎ The editor helps you with type errors
5: Running TypeScript code
6: Valid types
7: Type aliases and interfaces
8: Union types
9: Typing arrays with generics
10: The DX of editing TypeScript
11: There's more...
12: TypeScript declare a type that can be a string or array of strings
13: TypeScript, disable checks for `declared but its value is never read`
14: Object destructuring with types in TypeScript
15: TypeScript Tutorial
16: Zod: Type-Safe Schema Validation for TypeScript
17: How I fixed some trouble importing types in .d.ts files