Code from the page:
function removeTodo(index) {
-- todos.splice(index, 1)
-- todosList.childNodes[index].remove()
++ todos[index].done = true
}
In the 'removeTodo' function it is mentioned to only add 'todos[index].done = true' line but this is not giving expected result. we also need to add 'todosList.replaceChild(renderTodoInReadMode(todos[index]),todosList.childNodes[index])' to replace the existing child node with new node that contains the crossed out css.
Navigate to this link(solution for Exercise 23): https://github.com/angelsolaorbaiceta/fe-fwk-book/wiki/Solution-to-exercises#exercise-23
Code from the page: function removeTodo(index) { -- todos.splice(index, 1) -- todosList.childNodes[index].remove() ++ todos[index].done = true }
In the 'removeTodo' function it is mentioned to only add 'todos[index].done = true' line but this is not giving expected result. we also need to add 'todosList.replaceChild(renderTodoInReadMode(todos[index]),todosList.childNodes[index])' to replace the existing child node with new node that contains the crossed out css.