title: Local Storage not persisting after refresh
body: <p>My question is two fold, and would be nice to get another perspective.</p>
  
  <p>I am saving some data to localStorage, but if I refresh the data is gone. and the other question, is that only the last clicked item, is getting appended to localStorage. Any help would be great.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function getItem(callback){
    var itemsObj;
    $('.info').on('click', function(){
      itemsObj = {};
      $this = $(this);
      itemsObj.gameImg = $this.parent().parent().find('img').attr('src');
      itemsObj.gameTitle  = $this.parent().parent().find('h2').text();
      itemsObj.gameInfo = $this.parent().parent().find('p').text();
      // call the callback function parameter and send itemsObj as argument, callback function then received the argument as you wanted it to be. Then execute stuff from there.
      callback(itemsObj);
    });
  }
  
  // send a function instead for getItem to call when all is well
  getItem(function (data) {
     // here you will receive the data
     console.log('from function:', data);
     localStorage.data = (JSON.stringify(data));
     if(localStorage.getItem("data")){
      var savedLocal = localStorage.getItem("data");
      savedLocal = JSON.parse(savedLocal);
      var favsResult = $('.favs-display-data');
       favsOutput = `&lt;div class="col-lg-3 game"&gt;
                    &lt;div class="view view-first"&gt;
                      &lt;img src="${savedLocal.gameImg}"/&gt;
                      &lt;div class="mask"&gt;
                        &lt;h2&gt;${savedLocal.gameTitle}&lt;/h2&gt; 
                        &lt;p&gt;${savedLocal.gameInfo}&lt;/p&gt;
                        &lt;a href="#" class="info"&gt;♥&lt;/a&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;`
      favsResult.append(favsOutput);
     }
     console.log('savedLocal: ', savedLocal);</code></pre>
  </div>
  </div>
  </p>