title: JavaScript access the same array from different html pages
body: <p>I'm working on a web application, in which the values of an array is pushed through a JavaScript function call of one HTML page, and the same array needs to be accessed from another JavaScript function called by a different HTML page. </p>
  
  <p>The code at the moment is:</p>
  
  <pre><code>var global_array = [];
  
  function pushIntoArray(){
    global_array.push({"id":1, "value":"example1"}, {"id":2, "value":"example2"});
  }
  
  function getArrayValues(){
     console.log(global_array);
  }
  </code></pre>
  
  <p>The first function is called through a button click, the second function is called on a different page on page load. </p>
  
  <p>The problem I'm having is that when the second function getArrayValues() is called on a different HTML page, the values that were previously pushed into the array "global_array" disappears. </p>
  
  <p>What is the most efficient way solve this? Thanks.</p>