StaffCoder
TypeScript
Vanilla TypeScriptTypeScript 7.0
6 modules · 24 challengesSign up
Modules6 modules · 24 challenges
Learn to build DOM the way a maintainable frontend does — as pure render functions over typed data instead of ad-hoc jQuery-style mutation. Renderers take data and return fresh nodes, never reach into the document, and stay independently testable without a page. A single mount helper owns container mutation. The topic covers list rendering, exhaustive state rendering (loading / empty / error / list) over discriminated unions, safe text handling that resists XSS by using textContent and URL allow-listing, and template-driven filtered lists that re-render only what should change while the form retains user input. The recurring lesson: separate pure logic from DOM ownership, and every render leaves the container with exactly one child no matter what came before.
Finish every challenge, or complete the star challenge, to complete the module.

Challenges

4 challenges

Job Listing Board

Sign up to unlock
—No data yeteasy
About this challenge

Implement renderRow, renderList, renderPanel, and mount to turn a typed job array into an Open Positions panel. Renderers must be pure (no document queries, no side effects) and return fresh nodes; renderList([]) returns a documented empty-state node; mount replaces container contents so repeat calls leave exactly one child.

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

Notifications Feed

Sign up to unlock
—No data yeteasy
About this challenge

Implement renderFeed and the four state renderers. renderFeed dispatches on a discriminated FeedState union (loading | empty | error | list), swaps the container's single child, and wires an onRetry callback into the error state that fires exactly once per click. Switching between states must leave no residue from the previous state.

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

Course Review Comments

Sign up to unlock
—No data yeteasy
About this challenge

Implement renderComment + renderCommentList and the splitLines, truncate, isSafeUrl helpers. Review text is rendered via textContent only so a raw <script> never becomes an element; links are built from a separate url field and only when the scheme is http(s); long text truncates at 240 chars with an expand control that reveals the full body on click.

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

Recipe List Page

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

Implement pure helpers (parseFilters, applyFilters, formatCount) plus renderCard and renderResults. The filter form combines a title search, difficulty select, and max-time cap under AND semantics; submits re-render only the results panel while the form retains submitted values; no-match renders a single empty-state node; cards are built by cloning a <template>.

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

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.