title: Pushing csv file dataframe to an array
body: <p>I have this piece of code done in Javascript, where I want to save the name of colleges from an csv file  to an array named results. Although I can print values while I am inside the function the array is empty when I print it out of the function.</p>
  
  <pre><code>    const csv = require('csv-parser')
      const fs = require('fs')
      var results = [];
  
      fs.createReadStream('final.csv')
      .pipe(csv())
      .on('data', (data) =&gt; results.push(data['']))
      .on('end', () =&gt; {
      console.log(results);
      // Output -&gt; [ 'Cochise County Community College District', 'Empire Beauty School-Flagstaff',....]
      });
  
      console.log("List: "+results); //It prints [](empty array) here though
  </code></pre>