i have file.txt
apple     <--line 1 
banana    <--line 2
and this is my script
url = 'file.txt';
homelists = [];
$.get(url, function(data) {
  var lines = data.split("\n");    <--i want to split it by line
  $.each(lines, function(n ,urlRecord) {
    homelists.push(urlRecord);  <--add it to my homelists array
  });
});
console.log(homelists);   <-- returns array
console.log(homelists[0]);  <--undefined
my problem is i cant get the inside value of homelists how can i get homelists[0] or homelists[1]..(javascript or jquery(preferrable))
 
     
    