Skip to content

Commit 3c084ca

Browse files
implement the function deleteCompleted to handle the deletion of mass completed task
1 parent 924fde0 commit 3c084ca

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎Sprint-3/todo-list/todos.mjs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,7 @@ export function toggleCompletedOnTask(todos, taskIndex) {
2626
if (todos[taskIndex]) {
2727
todos[taskIndex].completed = !todos[taskIndex].completed;
2828
}
29-
}
29+
}
30+
export function deleteCompleted(todos) {
31+
return todos.filter((todo) => !todo.completed);
32+
}

0 commit comments

Comments
 (0)