TypeScript for Beginners: Catch Wrong Data Before It Runs
This is for people who already write basic JavaScript and want the compiler to catch wrong data before the code runs. You will add types to JavaScript you already know, compile with tsc, and stop guessing what a function accepts. If you skip the basics and add any until the red lines go away, you keep the old bugs and add a build step.
Course access
-
Before You Write Types (empty)3Lessons · 15 min
-
What TypeScript Adds on Top of JavaScript
What TypeScript adds to JavaScript, how a .ts file becomes the .js file that runs, and what types do not check. After this, you can say what the compiler will and will not catch.
5 min -
Install TypeScript and Run Your First .ts File
Install the compiler in a project, compile a .ts file, run the result and read the first error. After this, you have a working setup for every example in the course.
5 min -
-
-
Types You Cannot Skip (empty)4Lessons · 20 min
-
Annotating Variables Without Fighting the Compiler
Annotate variables, let inference do the rest, and handle null and the name clash that trips up new files. After this, you know when a type belongs in your code and when it is noise.
5 min -
Arrays, Objects and Nested Shapes
Describe arrays, objects and objects inside objects, and name a shape once with type. After this, a typo in a property name is a compile error.
5 min -
Optional, Readonly and Why any Is a Trap
Mark properties optional or readonly, handle the missing case, and see how any switches the checks off. After this, you reach for unknown instead of any.
5 min -
-
-
Functions That State Their Deal (empty)3Lessons · 15 min
-
Parameter and Return Types
Type parameters and return values, catch a missing return, and know where inline callbacks need no annotation. After this, a function states what it accepts and gives back.
5 min -
Optional and Default Parameters Without Surprises
Choose between an optional parameter and a default, avoid the zero bug of the or operator, and pass an options object when there are too many. After this, calls with missing arguments behave as you expect.
5 min -
-
-
Shapes You Can Reuse (empty)3Lessons · 15 min
-
Interfaces vs type Aliases: Pick One and Stick With It
See what interface and type share, where they differ, and set one rule for object shapes. After this, you stop switching between them by habit.
5 min -
Unions, Literals and Narrowing With typeof and in
Write unions and literal types, then narrow them with typeof and in. After this, a value that can be one of several things is safe to use.
5 min -
-
-
Compile Without the Mystery (empty)3Lessons · 15 min
-
tsconfig.json: target, module and strict
Create a tsconfig.json, read target, module and strict, and stop the compiler from writing files on errors. After this, you know which line decides what your output looks like.
5 min -
Reading tsc Errors Without Panicking
Read a tsc error as file, position, code and message, handle long messages, and find where an error really comes from. After this, a screen of errors is a list you can work through.
5 min -
-
-
Final Check: TypeScript for Beginners (empty)1Lessons · 15 min
-
About
This is for people who already write basic JavaScript and want the compiler to catch wrong data before the code runs. You will add types to JavaScript you already know, compile with tsc, and stop guessing what a function accepts. If you skip the basics and add any until the red lines go away, you keep the old bugs and add a build step.
- Responsible
- Christopher R
- Last Update
- 10/17/2026
- Completion Time
- 1 h 35 min
- Members
- 1
Reviews
Sign in to write a reviewComments
Sign in to commentNo comments yet.