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 itemcomplete(id)— mark item as doneremove(id)— delete an itemgetAll()— return all itemsgetPending()— 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.