Free

To-Do App in JavaScript

Render from state, never edit the page in place — the idea every framework is built on.

  • JavaScript
  • CSS
  • HTML

About this project

Add, tick, edit, delete, filter, drag to reorder and clear the finished ones, saved in localStorage so the list survives a reload. No framework, no build step, nothing fetched from the network.

The idea it is built around is that the list on screen is a pure function of one array. Ticking a box does not find that row and cross it out — it flips a boolean and asks for a redraw. That sounds like extra work until the fourth feature, and the README is specific about where the other approach breaks: once a filter exists, the function that ticks a box also has to decide whether the row still belongs on screen, update the counter, and do it identically in every code path. Miss one and something on screen disagrees with something else on screen.

The second theme is that localStorage is a stranger. It stores strings, so loading means JSON.parse on whatever happens to be there — someone else's key, a half-written value, or your own older format. This app validates every item, namespaces its key, versions its schema, and moves unreadable data aside rather than deleting it.

What you will learn

  • Keep one array as the only truth and redraw from it, instead of patching the DOM by hand
  • See why the in-place version stops scaling at about the fourth feature
  • Treat data read back from localStorage as untrusted input, not as your own objects
  • Version a saved schema, and refuse to overwrite data written by a newer version
  • Build filters, inline editing and drag-to-reorder without any of them knowing about each other

Before you start

  • JavaScript basics — arrays, objects and events
  • A browser and a text editor. Nothing to install.

New to JavaScript? The free JavaScript course covers everything this project assumes.

Academic integrity notice

These projects are provided for learning, experimentation and reference. Understand the code, modify it for your own requirements, and acknowledge external work according to your institution’s academic policies. Priodemy does not supply work to be submitted as your own.