Loading video player…

Your First TypeScript (Overview)

Welcome to Your First TypeScript: Types for JavaScript You Already Write. You’ve met TypeScript in packages, AI suggestions and job postings. In this course, you’ll add it to the JavaScript you write, with its checker as your reviewer.

The course follows Dee’s quote calculator at Spoke & Sprocket, a small bike-repair shop she runs with her brother. Her JavaScript prices repairs from parts, labor and a loyalty discount. Run as it is with node quote.js, two quotes come out wrong, and Kofi’s crashes the script:

Language: Program Output
Amara: $59.23
Luis: $57.49
Mei: $0.00
...
TypeError: Cannot read properties of undefined (reading 'totalCents')

In the course’s project, you’ll rename her script to TypeScript and fix what the checker finds. Then one command checks the code and reports nothing, and another runs it. Every quote matches the one Dee worked out by hand. You’ll set up both commands early in the course. Here’s what node quote.ts prints at the end:

Language: Program Output
Amara: $59.23
Luis: $65.48
Mei: $42.74
Kofi: $11.25

What You’ll Learn

By the end of this course, you’ll be able to:

  • Set up a small Node project to check and run TypeScript
  • Annotate functions and objects where inference needs help
  • Read a type error back to its cause
  • Say what any gives up

Then you’ll use it all on Dee’s quote calculator.

Before You Start

You need the JavaScript you already write, including modules, JSON and npm projects, but no other typed language. You’ll also need a terminal and an editor with TypeScript support.

You’ll use Node 26, and you’ll install TypeScript 7 in Checking and Running a Project.

How the Course Works

The course mixes text lessons, short videos, coding exercises in your browser, and a final quiz. For the project, you’ll set up Dee’s code on your machine, then explain your types to an AI mentor that reviews them. The sample code and slides are a download on the course page.

First up is Checking Code Before It Runs, and how Dee’s quotes could have been caught sooner.

Download

Course Slides (.pdf)

565.8 KB
Download

Sample Code (.zip)

9.0 KB

00:00 Welcome to Your First TypeScript: Types for JavaScript You Already Write. You’ve met TypeScript in packages, AI suggestions and job postings. Here, you’ll add it to the JavaScript you write, with its checker as your reviewer.

00:17 First, a taste of Dee’s quote calculator at Spoke and Sprocket. In JavaScript, two quotes come out wrong, and Kofi’s crashes the script. By the end, it’s TypeScript.

00:29 One command checks it and reports nothing, another runs it, and you’ll set both up early on. Every quote comes out right.

00:38 Dee runs the shop with her brother. Her script prices repairs from parts, labor and a loyalty discount, and that’s the script you’ll move to TypeScript.

00:49 You’ll learn to set up a small Node project to check and run TypeScript, and to add types where TypeScript can’t work them out. You’ll read a type error back to its cause, and say what the type any gives up.

01:02 The checker stops checking it. Then you’ll use it all on Dee’s quotes.

01:10 You need the JavaScript you already write, including modules, JSON and npm projects, but no other typed language. You’ll also need a terminal and an editor with TypeScript support.

01:22 You’ll use Node 26, and install TypeScript 7 in Checking and Running a Project. The course mixes text lessons, short videos, coding exercises in your browser, and a final quiz.

01:37 For the project, you’ll set up Dee’s code on your machine, then explain your types to an AI mentor that reviews them. Sample code and slides are on the course page.

01:48 First up is Checking Code Before It Runs, and how Dee’s quotes could have been caught sooner.

Become a Member to join the conversation.