title: How to update array with same key in Session Storage
body: <p>I am trying to store pages visited history in Session-storage.
  Session storage is working how I want.</p>
  
  <p><strong>Problem:</strong> 
  When I visit a 1st, 2nd, 3rd, &amp; 4th page and then visit the 2nd page and 3rd page again, it does not update the array again with the 2nd and 3rd page. </p>
  
  <p>Not appending data in array 2nd and 3rd page, these already exist but I visit  these pages again then it should be added in the array.</p>
  
  <p>I want to store every page visited in history in the array.     </p>
  
  <pre><code>if (window.sessionStorage) {
      var currentTite = document.title;
      var currentURL = window.location.href;
      sessionStorage.setItem(currentTite, currentURL);
      //var storedData = sessionStorage.getItem(currentTite);
  
      for (i = 0; i &lt;= sessionStorage.length - 1; i++) {
          key = sessionStorage.key(i);
          console.log(key);
          val = sessionStorage.getItem(key);
          console.log(val);
      }
  }
  </code></pre>