title: How to retrieve the JSON Data from localStorage
body: <p>I'm trying to make a function  that allow me to save variables using JSON.stringify, my code can save the data in localStorage, but, I don't know how can I retrieve it.</p>
  
  <p>here is my code:</p>
  
  <pre><code>&lt;body&gt;
  &lt;button id="btn"&gt; SAVE &lt;/button&gt;
  
  &lt;script&gt;
  if(btn){
    btn.addEventListener("click", function(){saveSession();})
  }
  function saveSession(){
   var session = {'myValues': [],'state': true};
   session.myValues.push({ 'value 1': '50'});
   session.myValues.push({ 'value 2': '100'});
   session.myValues.push({ 'value 3': '150'});
   alert("saved");
   localStorage.setItem('session', JSON.stringify(session));
   var restoredSession = JSON.parse(localStorage.getItem('session'));
  }
  &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>This code save the data in localStorage, but, what I want now is get the saved data <code>value 1</code> and assign its value, that would be 50 to some variable, lets say I have <code>var myValue</code> and <code>value 1</code> its equal 50, so, <code>myValue</code> would be 50. How can I do this?thanks in advance.</p>