title: JQuery and Phonegap save data from local storage in array
body: <p>I have data that stores in local storage, and I would like to pull it into array. but without success...
  As you will see in the following code, I am trying to console.log the array, but it write to me:</p>
  
  <p><strong>(Chrome console)</strong></p>
  
  <blockquote>
    <p>Uncaught SyntaxError: Unexpected end of input index.html:204 
    (anonymous function) index.html:204 e.resolveWith jquery-1.6.min.js:16</p>
    
    <p>e.extend.ready jquery-1.6.min.js:16 c.addEventListener.z jquery-1.6.min.js:16 </p>
    
    <p>cordova :: fired deviceready event! ripple.js:37</p>
    
    <p>8 canvas not found!</p>
  </blockquote>
  
  <p><strong>This is my local storage:</strong>
  <img src="https://i.stack.imgur.com/7g2FF.png" alt="enter image description here">
  <strong>And this is the code:</strong></p>
  
  <pre><code>            $(function() {
                  window.localStorage.setItem('Sample block', '{"time":1383107260539,"counter":5}');
  
                  track_items_for_chart = [];
  
                  for (i = 0; i &lt; window.localStorage.length; i++) {
                      var key_name = (window.localStorage).key(i);
  
                      var time = (window.localStorage.getItem(key_name));
                      time = (JSON.parse(time)).time;
                      var counter = jQuery.parseJSON(window.localStorage.getItem(key_name)).counter;
                      counter = JSON.parse(counter);
                      track_items_for_chart.push("{ date: " + time + ", km: " + counter + "},");
                  }
  console.log(track_items_for_chart);
  
      });
  </code></pre>