What is TypeScript?
TypeScript is JavaScript with added syntax for types. You describe the shape of your data, like a number, a string or an object with certain properties, and TypeScript checks your code against those descriptions before it runs. Microsoft released it in October 2012, and Anders Hejlsberg, the lead architect of C#, is one of its designers. Any JavaScript is already valid TypeScript, so you can add types to an existing project one file at a time.
TypeScript removes the types when it compiles your code, so the output is plain JavaScript that runs anywhere JavaScript does. Here, a union type limits an invoice's status to three values, and a typo gets flagged in your editor:
type Status = "draft" | "pending" | "paid";
function setStatus(invoiceId: string, status: Status) {}
setStatus("RT3080", "payed");
// Argument of type '"payed"' is not assignable
// to parameter of type 'Status'.
Why learn TypeScript?
Writing a type for an API response or a form's values raises questions you might skip in plain JavaScript, like whether a field can be missing or empty. Your editor then uses those types to autocomplete property names and flag mistakes as you type, which helps most in code you didn't write or haven't opened for a month.
Types don't change how your code runs, so bugs in your logic are still JavaScript bugs, and some type errors, especially from libraries, take practice to read. That's a good reason to get comfortable with JavaScript before adding TypeScript. Angular projects use TypeScript by default, and Vue's official project setup offers it as an option when you create an app.

Practice TypeScript on Frontend Mentor
Any Frontend Mentor challenge can be written in TypeScript, since you choose the language and tools. The ones with structured data give your types the most to do.
The Mortgage repayment calculator has a mortgage type that's either repayment or interest only, a small case for a union type and for turning form strings into numbers safely. Weather app pulls forecasts from the Open-Meteo API, so you'll type a real API response and handle values that might be missing. Invoice app is the biggest: invoices, line items, addresses and three statuses, shared between a list, a detail view and a form.
Take your TypeScript skills further
Want a more structured approach? This learning path takes you through its challenges in order, from first principles to real-world projects.
JavaScript frameworks and libraries
Using a JavaScript framework can provide many benefits. In this path, we outline core concepts and provide a sequence of challenges to help you reinforce knowledge and gain hands-on experience with your chosen framework.
Challenges to practice TypeScript with
Every challenge works with any tech stack. These are good ones to build with TypeScript, from easiest to hardest.
- Free
Age calculator app
- HTML
- CSS
- JS
juniorThis challenge is designed to sharpen your JavaScript and form validation skills. Working with dates in JavaScript can be tricky, so this will be a nice test!
- Free
Mortgage repayment calculator
- HTML
- CSS
- JS
juniorThis mortgage calculator is an excellent project for practicing working with forms, client-side validation, and updating the DOM. Remember to focus on accessibility, too!
- Free
Weather app
- HTML
- CSS
- JS
- API
intermediateBuild a responsive weather app with search functionality, unit conversion, and detailed forecasts using the Open-Meteo API.
- Premium
Frontend Quiz app
- HTML
- CSS
- JS
intermediateThis app will test your skills (as well as your knowledge!) as you build out a fully functional quiz. We provide a local JSON file to help you practice working with JSON!
- Premium
Link-sharing app
- HTML
- CSS
- JS
guruIn this project, you'll build a fully-functional link-sharing app for developers! You'll practice working with image uploads, repeater fields, drag-and-drop, and more!
- Premium
Invoice app
- HTML
- CSS
- JS
guruThis invoicing app project will test you on many levels. You'll be working with JSON data, managing state, plus a lot more. You can even build it out as a full-stack app!
Solutions made with TypeScript
Article preview component using React, Vite, Typescript, Tailwindcss
#react#vite#typescript#tailwind-cssLVL 4Submitted about 18 hours ago
Related technologies
What is Angular?
Angular is a TypeScript web framework from Google. It ships with routing, forms and an HTTP client, so most Angular apps follow the same structure.
What is React?
React is a JavaScript library, created at Facebook, for building user interfaces from components. You write them in JSX, and React keeps the page in sync.
What is Node.js?
Node.js is a JavaScript runtime built on Chrome's V8 engine. It runs JavaScript outside the browser, so you can write servers, APIs and command-line tools.
What is Next.js?
Next.js is a React framework for full-stack web apps. Its App Router turns folders into routes and renders pages as React Server Components by default.
Join 1,205,614 people building portfolio-worthy projects
Our highly supportive, positive community is here to help you improve your skills. We all try to help each other out wherever possible. We’d love to welcome you to our community!
Log in with GitHub











