Skip to main content

Practice TypeScript

Scrimba runs TypeScript inside the browser player: pause a scrim, widen a type, watch the compiler complain, fix it. The editor's hover popups only work live, so you read error messages with the mouse in the editor, not in the recording. Pair Learn TypeScript with free JavaScript and React scrims so types meet real components, not toy .ts files.

Reviewed inside the courses with a Pro account, September 2026.

Who this is for​

JS devs who pasted any to ship a feature and now need confidence before the next code review.

Why Practice TypeScript on Scrimba?​

  1. Pause and edit, change a type annotation and see what happens
  2. Instant feedback, TypeScript errors appear as you code
  3. Real projects, applications, not isolated exercises
  4. No setup required, no local toolchain needed

Top Courses to Practice TypeScript​

Learn TypeScript​

Level: Intermediate | Duration: 4.2 hrs | Access: Free

Three sections: Bob Ziroll's pizza-restaurant fundamentals (32 scrims, where Exercises 1 to 3 below live as object types, a seven-minute generics scrim, and unions narrowed with typeof), Rachel Johnson retyping Assembly: Endgame from Learn React (21 scrims), and a typed Express pet-shelter API (24 scrims). All three sections open without a paywall; the certificate is Pro.

Learn JavaScript​

Level: Beginner | Duration: 9.4 hrs | Access: Free

TypeScript builds on JavaScript. If you're new to both, start here: four builds (a passenger counter, blackjack, a Chrome extension, a mobile app) and 140+ challenges, all free; Pro gates three Solo Projects.

Learn React​

Level: Intermediate | Duration: 15.1 hrs | Access: Free

Finish the Assembly: Endgame capstone (2.2 hrs, 28 scrims) in particular, because the TypeScript course's React section takes that exact game and types it file by file. All six sections are free; Pro gates the two Solo Projects.

TypeScript Practice Exercises​

Exercise 1: Type a User Object​

// Start with this JavaScript and add types:
const user = {
name: "Alice",
age: 30,
email: "[email protected]",
isActive: true,
};

Practice defining interfaces, optional properties, and readonly modifiers.

Exercise 2: Generic Functions​

// Make this function work with any type:
function getFirst(items) {
return items[0];
}

Practice using <T> to create flexible, type-safe functions.

Exercise 3: Union Types for API Responses​

// Type this API response handler:
function handleResponse(response) {
if (response.status === "success") {
return response.data;
} else {
throw new Error(response.error);
}
}

Discriminated unions teach you how TypeScript narrows types based on conditions, essential for real API work.

How to Practice Effectively​

  1. Start with JavaScript you know, add types to existing code a file at a time
  2. Use strict mode, "strict": true in tsconfig.json forces you to handle edge cases
  3. Read the errors, they are verbose but informative
  4. Build something real, a todo app, an API client, or a CLI tool

When you're ready for this​

You are past syntax tutorials and need typed React and API code, without fighting your local tsconfig first.

Write TypeScript inside scrims

Learn TypeScript is free; add Pro when you want the full Frontend and Fullstack paths.

Try Scrimba free (opens in a new tab)