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?
- Pause and edit, change a type annotation and see what happens
- Instant feedback, TypeScript errors appear as you code
- Real projects, applications, not isolated exercises
- 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
- Start with JavaScript you know, add types to existing code a file at a time
- Use strict mode,
"strict": truein tsconfig.json forces you to handle edge cases - Read the errors, they are verbose but informative
- 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.
Related Practice Guides
- Practice JavaScript Arrays, master JS before adding types
- Practice React Hooks, apply TypeScript to React
- Practice API Calls, type your fetch requests
Related Pages
Learn JavaScript first. TypeScript adds types on top of JavaScript, so you need to understand the underlying language. Scrimba's free Learn JavaScript course is a great starting point.
If you already know JavaScript, you can learn basic TypeScript in a week. Mastering advanced features like generics, mapped types, and conditional types takes 2-4 weeks of practice.
Increasingly, yes. Most React job listings now expect TypeScript knowledge. Learning it gives you a significant competitive advantage in the job market.
Write TypeScript inside scrims
Learn TypeScript is free; add Pro when you want the full Frontend and Fullstack paths.