Skip to content

Brussels | ITP-2026-1 | Nik | Week 9 | Sprint 3 - Todo List#133

Open
bezdzenariy wants to merge 4 commits intoHackYourFutureBelgium:mainfrom
bezdzenariy:feature/todo
Open

Brussels | ITP-2026-1 | Nik | Week 9 | Sprint 3 - Todo List#133
bezdzenariy wants to merge 4 commits intoHackYourFutureBelgium:mainfrom
bezdzenariy:feature/todo

Conversation

@bezdzenariy
Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

Implemented deleteCompleted() feature for mass deletion of completed tasks:

  1. Added deleteCompleted() function in todos.mjs (filter + in-place splice)
  2. Added 3 unit tests covering mixed list, empty case, and all-completed case
  3. Added "Delete completed tasks" button in index.html
  4. Wired click handler in script.mjs that calls deleteCompleted() and re-renders

All 12 tests passing (9 existing + 3 new).

Implement deleteCompleted() in todos.mjs to remove all completed
tasks from the todos array using filter and in-place splice mutation.
Add 3 test cases:
- Delete all completed tasks from mixed list
- Do nothing when no tasks are completed
- Empty list when all tasks are completed
Add button element with id 'delete-completed-btn' after the
todo list to trigger mass deletion of completed tasks.
Register click event listener on delete-completed-btn that calls
Todos.deleteCompleted() and re-renders the list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant