Sheffield | 26-ITP-Jan | Mahmoud Shaabo | Sprint 3 | ToDo List App#1136
Sheffield | 26-ITP-Jan | Mahmoud Shaabo | Sprint 3 | ToDo List App#1136mahmoudshaabo1984 wants to merge 1 commit into
Conversation
|
Hi @cifarquhar, As I submit my Pull Request for the ToDo List App, I want to take a moment to thank you for all your efforts and the valuable knowledge you share with us in this course. For this task, I have successfully implemented the mass delete feature for completed ToDos, making sure the business logic in Thank you again for your time and continuous support! Best regards, |
Luro91
left a comment
There was a problem hiding this comment.
Well done. The implementation works as expected
| for (let i = todos.length - 1; i >= 0; i--) { | ||
| if (todos[i].completed === true) { | ||
| todos.splice(i, 1); | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
This works correctly. You can also research build in array functions. There is a function that allows you filter elements in an array based on a condition.
|
Closing PR because the January ITP run has finished. Feel free to re-open if you're still working on it. |
Hello Reviewers / CodeYourFuture Team,
I have completed the ToDo List App project for Sprint 3. I am excited to share that I have successfully implemented the mandatory requirement for the mass delete feature.
🎯 Acceptance Criteria Met:
index.htmlwith the correct ID.deleteCompleted(todoList)function intodos.mjsto remove all completed tasks.todos.test.mjsto verify the logic works correctly (including edge cases).deleteCompletedTodosfunction inscript.mjsand successfully updated the DOM.💻 Technical Implementation Details:
forloop in thedeleteCompletedfunction. This approach ensures that modifying the array length during iteration does not cause index shifting or skip any items, which is a common issue when usingsplice()in a standard forward loop.npm test) are passing successfully.Thank you for your time and feedback!
Best regards,
Mahmoud Shaabo