Skip to content

London | 26-ITP-May | Damilola Odumosu| Sprint 3 | ToDo List - #1383

Open
d-odumosu wants to merge 1 commit into
CodeYourFuture:mainfrom
d-odumosu:coursework/sprint-3/todo-list
Open

London | 26-ITP-May | Damilola Odumosu| Sprint 3 | ToDo List#1383
d-odumosu wants to merge 1 commit into
CodeYourFuture:mainfrom
d-odumosu:coursework/sprint-3/todo-list

Conversation

@d-odumosu

Copy link
Copy Markdown

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

  • added functionality to delete all completed todos

  • added new button

  • implemented jest test

@d-odumosu d-odumosu added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Data-Groups The name of the module. 📅 Sprint 3 Assigned during Sprint 3 of this module and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 6, 2026

@LonMcGregor LonMcGregor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work, the todolist works, but I have some questions about the code style used

// Set up tasks to be performed once on page load
window.addEventListener("load", () => {
document.getElementById("add-task-btn").addEventListener("click", addNewTodo);
document.getElementById("delete-btn").addEventListener("click", (e) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above event listener uses a named function rather than an anonymous function, could you make these consistent?

export function deleteCompleted(todoList) {
const incompleteTodos = todoList.filter((todo) => !todo.completed);
todoList.length = 0; //empty the original array
todoList.push(...incompleteTodos); //push incompleted task

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you seem to be overriding the todoList with some new values - What is your reasoning for doing it this way with setting length to zero then pushing? Are there any alternative ways of achieving this?

@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Data-Groups The name of the module. Reviewed Volunteer to add when completing a review with trainee action still to take. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants