-
-
Notifications
You must be signed in to change notification settings - Fork 94
ITP_LONDON | PRISCILLA_EMEBO | Module-Data-Groups | Todo-list #510
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
base: main
Are you sure you want to change the base?
Conversation
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.
Code looks good.
checkIcon.style.cursor = "pointer"; | ||
checkIcon.addEventListener("click", () => { | ||
todo.completed = !todo.completed; | ||
li.style.textDecoration = todo.completed ? "line-through" : "none"; |
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.
We could just call populateTodoList()
to update the view (to avoid maintaining two sets of code to change view).
trashIcon.className = "fa fa-trash ms-2"; | ||
trashIcon.style.cursor = "pointer"; | ||
trashIcon.addEventListener("click", () => { | ||
todos.splice(todos.indexOf(todo), 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.
For better performance (i.e., without the need to search for todo
in the array), we could make available the index of the current todo
at line 11 as
todos.forEach((todo, index) => {
Thank you very much. I'll make the necessary changes |
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
Questions
Ask any questions you have for your reviewer.