Byte's to-do list has three buttons: All, Active, Done. Each button calls the same drawing function — with the same array of to-dos but a different filter.
Write renderTodos(todos, filter). The to-dos are an array of { title, done }; the filter is "all", "active" (not done) or "done" (done).
<ul id="list"> must end up with only the matching to-dos: one <li> per to-do, its text is the title, done ones get the class done.- The function is called many times: each call draws the list from scratch, no old items stay behind.
- Write
Showing N of M into <p id="summary">: how many to-dos are visible and how many there are in total. - A title is text, even if it has angle brackets in it.