Skip to main content
🛠️ Portfolio Projects

Build a To-Do List

Every developer has built a to-do app. The difference is how you build it.

A solid to-do list demonstrates:

  • CRUD operations (Create, Read, Update, Delete)
  • State management (adding, removing, toggling)
  • Data structures (arrays of objects)
  • Clean function design

The Spec

Build a TodoList class with:

  • add(text) — add a new item
  • complete(id) — mark item as done
  • remove(id) — delete an item
  • getAll() — return all items
  • getPending() — return only incomplete items

Each item: { id, text, done: boolean }

Why This Matters

Every CRUD app (Twitter, GitHub, Gmail) is fundamentally this:

  • Users → tweets, repos, emails
  • Add, read, update, delete

Nail this pattern and you understand 80% of web development.

⚡ 40 XP
solution.jsRuns in your browser
Loading editor…
Tests4 to pass
add returns item with id
complete marks done
remove deletes item
getPending filters done items

Run your code to check these.