TypeScript 7 Type System

Get fluent in the TypeScript 7 types that show up in real code, and learn what each compiler error is protecting you from. Every example is checked by the compiler and then run in Node, so you see the bug a type would have stopped. You’ll start with annotations and inference, arrays, tuples and literal types. You’ll model objects with type aliases and interfaces, extend and intersect them, and handle optional and read-only properties with optional chaining and nullish coalescing. You’ll combine types into unions and narrow them with runtime checks, then tag shapes so a switch statement covers every case. You’ll finish with null and undefined, checked index access, and the any, unknown and never types, and model a typed shopping cart.

For beginners who can already compile and run a TypeScript file.

Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.