StaffCoder
TypeScript

TypeScript Exercises

TypeScript 7.0
6 modules · 24 challengesSign up
Modules6 modules · 24 challenges
Master the essentials of working directly with the DOM to build responsive, interactive interfaces without frameworks.
Finish every challenge, or complete the star challenge, to complete the module.

Challenges

4 challenges

Product Card Renderer

Sign up to unlock
25%2 of 8 solvedeasy
About this challenge

Build an entire product card in TypeScript from a product object (name, price, rating, inStock, imageAlt) — create every element, set text content, the image alt, a data-* attribute for the id, and a stock class derived from inStock. Format the price to two decimals. The renderer returns the node without ever touching the document, and two calls with the same product produce two independent nodes.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Notice Banner States

Sign up to unlock
50%1 of 2 solvedeasy
About this challenge

Implement a banner controller that switches between four states (info, success, warning, error) using classList only, sets the message text via textContent, and updates role and aria-live to match the state. Hiding the banner clears the message and removes every state class so states never overlap.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Table Row Builder

Sign up to unlock
100%1 of 1 solvedeasy
About this challenge

Build table rows from an array of records using createElement and a DocumentFragment, appending to <tbody> in a single operation. Money cells receive a numeric class; each row carries a data-* id; cell text is set via textContent so a value containing angle brackets renders as text, not markup; and an empty array leaves the <tbody> untouched.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Dashboard Tile Grid

STAR
Solving it completes the module
50%1 of 2 solvedeasy
About this challenge

Build one tile per metric from an array (label, value, unit, delta, target), each field in its own slot, with a data-* attribute for the metric key and a trend class derived from the sign of delta (including zero). Tiles whose value is below target carry a below-target marker; an empty array renders a no-data element and no tiles at all.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

About this path

Finish confident in building, structuring, and reasoning about JavaScript applications without relying on frameworks.

This path uses TypeScript in the browser: selecting and changing the DOM, building elements, handling forms, organizing code into modules, and transforming arrays of data. You should know basic JavaScript and HTML before you start. No earlier TypeScript experience is needed. The data module turns raw records into views, such as a leaderboard and an inventory summary panel.

Frequently asked questions

4

What will I practice in this path?

6 modules: Dom Selection & Manipulation, Events & Event Handling, Forms & Input Handling, Rendering & DOM Construction, Modules & Code Organisation and Arrays & Data Transformation.

How many TypeScript exercises are there, and how hard are they?

24 exercises, all easy.

What does this path run on?

Challenges run on TypeScript 7.0.

Do I need to install anything?

No. Every challenge runs in a browser-based IDE with everything already set up, and your code is graded automatically against a test suite.

We use cookies that are necessary to run Staffcoder, and optional analytics cookies to see which pages get used. Analytics stays off unless you accept. Read our Cookie Policy.