title: Reading .txt file into array Javascript/jQuery
body: <p>I am trying to read a file (stored on the web server) into an array. When I print the array I currently get "undefined". Here is the code im using:</p>
  
  <pre><code>var cardRules = new Array;
      $.get('UserFile.txt', function(data){
              var array = data.split('\n');
              console.log(cardRules);
          });
  </code></pre>
  
  <p>Any help would be appreciated!</p>