Build day
Today you build the habit tracker's core: add habits, show them, and tick them off for today. You'll use objects, arrays, DOM, events and the data → render pattern.
Today's date as a key
Each habit stores the days it was done as strings like "2026-10-08". A helper gives today's date in that format:
const today = () => new Date().toISOString().slice(0, 10);
console.log(today());
const habit = { name: "Walk", days: [] };
habit.days.push(today());
console.log(habit.days.includes(today()));