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:
Stefan Keim 2016-04-27 08:50:54 +02:00
parent ba378d3652
commit 5fe5b5029b

View file

@ -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--])
}
}