title: Javascript localStorage loop outputting only last item
body: <p>Hello i have problem with javascript for loop, i have 2 items in localStorage:</p>
  
  <pre><code>{"nazev":"1","sire":"2","mnozstvi":"3","barva":"4","typ":"5","slozeni":"6","strec":"7","poznamka":"8"}
  {"nazev":"9","sire":"10","mnozstvi":"11","barva":"12","typ":"13","slozeni":"14","strec":"15","poznamka":"16"}
  </code></pre>
  
  <p>my code:</p>
  
  <pre><code>if(window.localStorage.length &gt; 0) {
      for (var i = 0, len = localStorage.length; i &lt; len; i++) {
          var foo = localStorage.getItem(localStorage.key(i));
      }
      //con
      $('#nv').html(foo);
  }
  </code></pre>
  
  <p>and html output (console.log is outputting both; but this not):</p>
  
  <pre><code>{"nazev":"9","sire":"10","mnozstvi":"11","barva":"12","typ":"13","slozeni":"14","strec":"15","poznamka":"16"}
  </code></pre>
  
  <p>if someone know why it's happening and how i can fix it :/</p>