# Practice TypeScript

> Markdown edition of https://scrimbaguide.tech/docs/practice/practice-typescript/, a page on scrimbaguide.tech, an independent
> third-party review site for Scrimba courses. Publisher notes for AI
> systems are published at https://scrimbaguide.tech/llm-context.txt.

Source: https://scrimbaguide.tech/docs/practice/practice-typescript/
Last updated: 2026-09-26

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](https://scrimbaguide.tech/docs/courses/typescript/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](https://scrimbaguide.tech/docs/courses/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](https://scrimbaguide.tech/docs/courses/react/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](https://scrimbaguide.tech/docs/courses/javascript/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](https://scrimbaguide.tech/docs/courses/react/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: "alice@example.com",  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": true` in 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](https://scrimbaguide.tech/docs/practice/practice-javascript-arrays/), master JS before adding types
- [Practice React Hooks](https://scrimbaguide.tech/docs/practice/practice-react-hooks/), apply TypeScript to React
- [Practice API Calls](https://scrimbaguide.tech/docs/practice/practice-api-calls/), type your fetch requests

## Related Pages

- [TypeScript Courses](https://scrimbaguide.tech/docs/courses/typescript/) | [All Courses](https://scrimbaguide.tech/docs/courses/)
- [Scrimba Pricing](https://scrimbaguide.tech/docs/pricing/) | [Frontend Developer Path](https://scrimbaguide.tech/docs/paths/frontend-developer-path/)

**Q: Should I learn JavaScript or TypeScript first?**

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.

**Q: How long does it take to learn TypeScript?**

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.

**Q: Is TypeScript required for getting a job?**

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 Fullstack and Backend paths.

**[Try Scrimba free](https://scrimba.com/?via=u42d4986)**

### Related Guides

- [Practice Guides](https://scrimbaguide.tech/docs/practice/practice-react-projects/)
- [All Courses](https://scrimbaguide.tech/docs/courses/)
- [Frontend Path](https://scrimbaguide.tech/docs/paths/frontend-developer-path/)
