title: How do I read csv file in an array in Javascript?
body: <p>This is my first time with javascript and I am stuck on a problem. I have to read from csv file which contains names of top 1 million websites based on Alexa traffic. The size of csv file is 22.5 MB. Based on some tutorials on net, I am trying to do like this:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
      &lt;head&gt;
          &lt;title&gt;three.js webgl - interactive cubes&lt;/title&gt;
          &lt;meta charset="utf-8"&gt;
          &lt;meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"&gt;
          &lt;style&gt;
              body {
                  font-family: Monospace;
                  background-color: #f0f0f0;
                  margin: 0px;
                  overflow: hidden;
              }
          &lt;/style&gt;
      &lt;/head&gt;
      &lt;body&gt;
  
          &lt;script src="./three.min.js"&gt;&lt;/script&gt;
          &lt;script src="./jquery-2.1.0.min.js"&gt;&lt;/script&gt;
          &lt;script src="./stats.min.js"&gt;&lt;/script&gt;
          &lt;script src="./jquery.csv-0.71.js"&gt;&lt;/script&gt;
  
          &lt;script&gt;
          var data = $.csv.toObjects('top_1m.csv');
          console.log(data);
          &lt;/script&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>But I am not getting any output on console except []. What is wrong with this? Also is the correct way to do this. Basically I need to read file one time in array and then use that array for further processing.</p>