title: After leaving .get array loses data
body: <p>I know there is something I am missing about Ajax but I need help to understand. In the following code myArray has its content at label "A" but is empty at label "B". The purpose of the code is to read multiple csv files, store some values from each of the files and use myArray later in the script. I know there must be something with vars in the Ajax request (.get). Thanks</p>
  
  <pre><code>var myArray = [];
  var lines = [];
  
  $.each(fileNames, function(lineNo, file) 
  {
      $.get(file, function(data) 
      {
          lines = $.csv.toObjects(data);
          $.each(lines, function(lineNo, line) 
          {
              ... code ...
              myArray.push(someValue);
          });
          --- A ---
      });
      --- B ---
  });
  </code></pre>