title: Looping through localStorage in HTML5 and JavaScript
body: <p>So, I was thinking I could just loop through localStorage like a normal object as it has a length. How can I loop through this?</p>
  
  <pre><code>localStorage.setItem(1,'Lorem');
  localStorage.setItem(2,'Ipsum');
  localStorage.setItem(3,'Dolor');
  </code></pre>
  
  <p>If I do a <code>localStorage.length</code> it returns <code>3</code> which is correct. So I'd assume a <code>for...in</code> loop would work.</p>
  
  <p>I was thinking something like:</p>
  
  <pre><code>for (x in localStorage){
      console.log(localStorage[x]);
  }
  </code></pre>
  
  <p>But no avail. Any ideas?</p>
  
  <p>The other idea I had was something like</p>
  
  <pre><code>localStorage.setItem(1,'Lorem|Ipsum|Dolor')
  var split_list = localStorage.getItem(1).split('|');
  </code></pre>
  
  <p>In which the <code>for...in</code> does work.</p>