title: Unshift continuous loop?
body: <p>I'm trying to add an item from a loop to beginning of my 'storedCompletion' array but for some reason it just continues looping and crashes the browser.</p>
  
  <p>I don't understand why because after it's looped through each object in the array it checks to see if the object id matches up with the list items element id so it should run on one occasion?</p>
  
  <p>JS</p>
  
  <pre><code>  if(localStorage) {
      var storedCompletion = JSON.parse(localStorage.getItem('todos'));
    }
  
    for(var f=0; f&lt;storedCompletion.length; f++) {
      if(storedCompletion[f].id == listItem.id) {
        storedCompletion[f].completed = false;
        console.log(storedCompletion);
        storedCompletion.unshift(storedCompletion[f]);
        console.log(storedCompletion);
      }
    }
    localStorage.setItem('todos', JSON.stringify(storedCompletion));
  </code></pre>