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
You have written a really nice markTodo function in logic.js. 🥇
But, if the very first todo in the array meets the if condition on line 60, the loop will continue to go through the remaining todos.
for (let item of newTodos) {
if (item.id == idToMark) {
item.done ? (item.done = false) : (item.done = true);
}
}
You can add a return statement after line 61 to make the loop exit as soon as the if condition is met 👍 this will make your code run faster, especially if the todo array is very long!
The text was updated successfully, but these errors were encountered:
You have written a really nice markTodo function in logic.js. 🥇
But, if the very first todo in the array meets the if condition on line 60, the loop will continue to go through the remaining todos.
You can add a
return
statement after line 61 to make the loop exit as soon as the if condition is met 👍 this will make your code run faster, especially if the todo array is very long!The text was updated successfully, but these errors were encountered: