The to-do app keeps one rule: the array is the truth, and the DOM is a picture of it. Every update therefore returns a new array instead of editing the old one — that is what lets you re-render from state and compare before/after.
Write toggleTodo(todos, id) that returns a new array where the matching to-do has its done flipped.
- the original array and its objects must be left untouched
- to-dos that did not change should be the same object in the new array
- an id that matches nothing just returns an equivalent list