Learning TypeScript

A friendly next step after JavaScript that introduces type checking, typed variables, functions, arrays, objects, unions, and a typed task planner.

Learning TypeScript

Welcome to Learning TypeScript.

This project is a friendly next step after basic JavaScript. TypeScript is JavaScript with extra type checking, which helps you catch mistakes earlier.

Each module has two main files:

  • README.md: the lesson instructions
  • index.ts: the TypeScript file you will run and edit

The best way to learn is simple:

  1. Open the module folder.
  2. Read the README.md.
  3. Open index.ts.
  4. Run the code.
  5. Change something small.
  6. Run it again and notice what changed.

Table of Contents

  1. What you will learn
  2. How to use this course
  3. How to run a module
  4. Modules overview
  5. Final project
  6. Tips for learning
  7. Wrap up

What you will learn

By the end of this course, you will have practiced:

  • how to run your first TypeScript program
  • how to add simple types to variables
  • how to write functions with typed parameters and returns
  • how to describe groups of values and object shapes
  • how to handle values that can have more than one type
  • how to build a small typed task planner
  • building a small final project

You will not know every part of TypeScript yet, and that is completely fine.

How to use this course

Start with Module 1 and go in order. Each module adds one small TypeScript idea to JavaScript you may already recognize.

How to run a module

Open the terminal from the learning-typescript folder.

Then run a module like this:

tsx 01_welcome_to_typescript/index.ts

For another module, change the folder name.

Modules overview

Module 1: Welcome to TypeScript

You will run your first TypeScript program.

This module keeps the examples small so the types are easy to see.

Module 2: Types and Annotations

You will add simple types to variables.

This module keeps the examples small so the types are easy to see.

Module 3: Functions with Types

You will write functions with typed parameters and returns.

This module keeps the examples small so the types are easy to see.

Module 4: Arrays and Objects

You will describe groups of values and object shapes.

This module keeps the examples small so the types are easy to see.

Module 5: Unions and Narrowing

You will handle values that can have more than one type.

This module keeps the examples small so the types are easy to see.

Final Project: Task Planner

You will build a small typed task planner.

This module keeps the examples small so the types are easy to see.

Final project

Final Project: Task Planner

At the end of the course, you will build a small typed task planner. It uses typed objects, arrays, functions, and a union type for task status.

Tips for learning

Run the code often. Change one type or one value at a time. If TypeScript complains, read the message slowly. It is trying to point you toward a mismatch.

Wrap up

TypeScript helps you describe what your JavaScript values should look like. That makes larger programs easier to change with confidence.

Project details
Javascript

Environment

Javascript

JavaScript workspace with Node.js LTS, Corepack, Bun, TypeScript, tsx, nodemon, ESLint, Prettier, and PM2.

Availability

Always open

Extension Marketplace

Enabled

Starter Files

Included in workspace

Anoch Jeyakanthan

Created By

Anoch Jeyakanthan