Skip to content

TypeScript Foundations

TypeScript Foundations picks up where Intermediate JavaScript left off. You can write modern, capable JavaScript. Now you will add the static type system that defines professional Angular, Node.js, and React development.

Every concept in this course is applied directly to AceIt — a browser-based trivia quiz app you build from scratch and ship as a complete, working app by the final module.

  • TypeScript basics — what the compiler does, how to install it, and how tsconfig.json controls the build
  • Core typesstring, number, boolean, arrays, tuples, object types, union and intersection types, literal types, and enums
  • Interfaces and type aliases — named shapes for objects, optional and readonly properties, extending and composing types
  • Functions and classes — typed parameters, return types, function type expressions, access modifiers, and readonly fields
  • Generics — reusable typed functions and interfaces, constraints, and the most useful built-in utility types
  • Type narrowingtypeof, instanceof, the in operator, discriminated unions, type predicates, and the unknown type

This course assumes you have completed Intermediate JavaScript or have equivalent knowledge. You should be comfortable with ES6 classes, ES modules, async/await, the Fetch API, and localStorage. No prior TypeScript experience is assumed.

All seven modules build the same real application — AceIt, a browser-based trivia quiz powered by the Open Trivia DB API. You can play the finished app or browse the source on GitHub.

The finished app:

  • Fetches live trivia questions from the Open Trivia DB API and models the response with typed interfaces
  • Lets you choose difficulty and question count before each round
  • Uses a QuizEngine class with typed properties, private fields, and static methods
  • Wraps fetch in a generic fetchJson<T> function so the API response is fully typed
  • Uses a discriminated union to model quiz state (idle, loading, active, done)
  • Persists your high score to localStorage and displays it on the start screen

By Module 07 you will wire all of these pieces together into a working, deployable app.