Web developmentIntermediate

TypeScript Basics

This course guides you step by step through learning TypeScript, from installation to generics and utility types, including basic types, interfaces, functions, unions and classes. Each lesson combines explanation, concrete example and small hands-on exercise. Prerequisite: knowing the basics of JavaScript.

12 lessons
Start the course

Course content

  1. 1

    Introduction to TypeScript

    Understand what TypeScript is, why it exists and what it brings to JavaScript.

  2. 2

    Installation and Configuration

    Install TypeScript with npm, compile a file and configure tsconfig.json.

  3. 3

    Basic Types

    string, number, boolean, type inference, any and unknown.

  4. 4

    Arrays and Tuples

    Type arrays, use tuples and protect data with readonly.

  5. 5

    Objects and Interfaces

    Describe the shape of an object with interfaces, optional properties and extends.

  6. 6

    Functions

    Type parameters and return values, default values, callbacks, void and never.

  7. 7

    Unions and Narrowing

    Combine types with |, narrow with typeof, literal types and discriminated unions.

  8. 8

    Aliases, Intersections and Enums

    type, &, enum, as const and type assertions: name and combine your types.

  9. 9

    Classes

    Typed properties, access modifiers, inheritance and implements.

  10. 10

    Generics

    Write reusable code that keeps type safety, with T and extends.

  11. 11

    Utility Types

    Partial, Pick, Omit, Readonly, Record, keyof and typeof to derive types.

  12. 12

    Modules, Libraries and the DOM

    import / export, @types packages, typing the DOM and API data.