correct index
```todos.splice(index, 1)``` in destroy makes the elements shift; therefor loops index has to be aligned has to be corrected
This commit is contained in:
parent
ba378d3652
commit
5fe5b5029b
1 changed files with 1 additions and 1 deletions
|
|
@ -39,7 +39,7 @@ function countRemaining() {
|
|||
}
|
||||
function clear() {
|
||||
for (var i = 0; i < todos.length; i++) {
|
||||
if (todos[i].completed) destroy(todos[i])
|
||||
if (todos[i].completed) destroy(todos[i--])
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue