title: Array.push not updating an array variable
body: <p>Here is the code I am working on:</p>
  
  <pre><code>&lt;!--HTML Code for referencing the file --&gt;
  &lt;input type="file" name="file" id="file"&gt;
  &lt;script&gt;
  var store = [];
  document.getElementById('file').onchange = function(){
      var file = this.files[0];
      var reader = new FileReader();
  
      // Define the body of reader function
      reader.onload = function(progressEvent){
  
      // By lines
      var lines = this.result.split('\n');
      for(var line = 0; line &lt; lines.length; line++){
  
      // Store it in an array
      store.push(lines[line]);
      //console.log(store.length); // This line on being uncommented
      // shows that store is being modified. The values getting printed
      // are 1,2,3, ...... upto 16 (length of the input file)
  }
  };
  
  // Read the file and store it in the var "store"
  reader.readAsText(file);
  console.log(store.length); // The problem appears here!!!!!
  };
  &lt;/script&gt;
  </code></pre>
  
  <p>The problem is, even after choosing a file containing 16 sample numbers, the console prints the store.length value as 0. Why is the push command not affecting the var "store" ?</p>