-
-
Notifications
You must be signed in to change notification settings - Fork 283
Manchester | 26-ITP-Jan | Mehroz Munir | Sprint 3 | Todo List App #1117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,8 +10,8 @@ | |
| */ | ||
|
|
||
| // Append a new task to todos[] | ||
| export function addTask(todos, task, completed = false) { | ||
| todos.push({ task, completed }); | ||
| export function addTask(todos, task, completed = false, deadlineDate = null) { | ||
| todos.push({ task, completed, deadlineDate }); | ||
| } | ||
|
|
||
| // Delete todos[taskIndex] if it exists | ||
|
|
@@ -26,4 +26,11 @@ export function toggleCompletedOnTask(todos, taskIndex) { | |
| if (todos[taskIndex]) { | ||
| todos[taskIndex].completed = !todos[taskIndex].completed; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // Delete all completed tasks | ||
| export function deleteCompleted(todoList) { | ||
| for (let index = todoList.length - 1; index >= 0; index--) { | ||
| if (todoList[index].completed) todoList.splice(index, 1); | ||
| } | ||
|
Comment on lines
+33
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This works.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, the filter function. I realize now that it would be better to use that here. |
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIce implementation of stretch task 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your review.