You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*** list.js *** static getDeleteButton(id) { const deletebtns = document.querySelectorAll('button[type=submit][id=delete-btn'); const deletebtn = deletebtns[id]; return deletebtn; }
Line 80 - getDeleteButton function is not being used, I can comment/remove this part of code. YAGNI
static completeItem(event) { const listArray = List.dataArray(); if (listArray[event.target.value - 1].completed === false) { listArray[event.target.value - 1].completed = true; localStorage.setItem('listArray', JSON.stringify(listArray)); } else { listArray[event.target.value - 1].completed = false; localStorage.setItem('listArray', JSON.stringify(listArray)); } }
Line 96 and Line 99 - Repeated same line inside both If's conditions, I could place this line after the IF statement and remove 1 line of the function, because this one will be executed independent of which IF condition are we in.
The text was updated successfully, but these errors were encountered:
HTML and CSS looks Ok in my project.
*** list.js ***
static getDeleteButton(id) { const deletebtns = document.querySelectorAll('button[type=submit][id=delete-btn'); const deletebtn = deletebtns[id]; return deletebtn; }
Line 80 - getDeleteButton function is not being used, I can comment/remove this part of code. YAGNI
static completeItem(event) { const listArray = List.dataArray(); if (listArray[event.target.value - 1].completed === false) { listArray[event.target.value - 1].completed = true; localStorage.setItem('listArray', JSON.stringify(listArray)); } else { listArray[event.target.value - 1].completed = false; localStorage.setItem('listArray', JSON.stringify(listArray)); } }
Line 96 and Line 99 - Repeated same line inside both If's conditions, I could place this line after the IF statement and remove 1 line of the function, because this one will be executed independent of which IF condition are we in.
The text was updated successfully, but these errors were encountered: