Skip to content

Commit f997781

Browse files
author
russom
committed
Delete completed function started being implemented
1 parent e72732e commit f997781

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,13 @@ export function toggleCompletedOnTask(todos, taskIndex) {
2626
if (todos[taskIndex]) {
2727
todos[taskIndex].completed = !todos[taskIndex].completed;
2828
}
29+
}
30+
31+
// To remove all completed ToDos from the given list.
32+
export function deleteCompleted(todoList) {
33+
if (todoList) {
34+
toggleCompletedOnTask(todoList);
35+
}
36+
37+
2938
}

0 commit comments

Comments
 (0)