Skip to content

Typescript Essentials Textbook

A free, self-paced textbook in 8 chapters. Read a chapter, then drill it with the 51 companion flashcards using spaced repetition.

8 chapters · 51 cards · Updated

Chapters

  1. 1Introduction to TypeScript & Setup

    TypeScript is a statically typed superset of JavaScript developed by Microsoft. Because it builds on top of JavaScript, every valid JavaScript file is also a valid TypeScript file,...

  2. 2Basic Types & Type System Fundamentals

    TypeScript's type system starts with a small set of primitive types: number, string, boolean, null, undefined, symbol, and bigint. These primitives serve as the building blocks for...

  3. 3Functions & Collection Types

    TypeScript supports multiple ways to express collections of values. Arrays can be written using either bracket syntax, such as let numbers: number[] = [1, 2, 3];, or the generic Ar...

  4. 4Interfaces, Type Aliases & Object Shapes

    Interfaces describe the shape of objects by declaring the names and types of their members. A simple interface Person { name: string; age: number; } tells the compiler that any val...

  5. 5Classes & Object-Oriented Programming

    Classes in TypeScript follow standard JavaScript class syntax with the addition of type annotations. A class such as class Animal { name: string; constructor(name: string) { this.n...

  6. 6Generics for Reusable Code

    Generics let you write functions, interfaces, and classes that operate on multiple types while preserving full type safety. A generic identity function written as function identity...

  7. 7Modules & Advanced Type-Level Features

    TypeScript supports ES module syntax: import { ModuleName } from './module'; pulls in named exports, import * as Module from './module'; imports a whole namespace, and exports are...

  8. 8Strict Mode & Interoperability with JavaScript

    Strict mode, enabled by setting "strict": true in tsconfig.json, turns on a collection of more rigorous type-checking options, including strictNullChecks and several others. Activa...

← Back to the Typescript Essentials deck