title: adding objects to array in localStorage
body: <p>Ok, I've tried to follow examples here, I know there might be a few different ways of adding objects to an array in localstorage and not overwriting it but I'm failing to find at least one of them.</p>
  
  <p>Got this code to store objects in array but it's overwriting itself. May anyone show me what am I missing? (And I'm afraid I could be missing a lot).</p>
  
  <pre><code>function addEntry() {
      var entryTitle = document.getElementById("entryTitle").value;
      var entryText = document.getElementById("entryText").value;
      var entry = {
          "title": entryTitle,
          "text": entryText
      };
      localStorage.setItem("entry", JSON.stringify(entry));
      var allEntries = [];
      allEntries.push(entry);
      localStorage.setItem("allEntries", JSON.stringify(allEntries));
  };
  </code></pre>