title: How to read text file in JavaScript
body: <p>I am trying to load a text file into my JavaScript file and then read the lines from that file in order to get information, and I tried the FileReader but it does not seem to be working. Can anyone help?</p>
  
  <pre><code>function analyze(){
     var f = new FileReader();
  
     f.onloadend = function(){
         console.log("success");
     }
     f.readAsText("cities.txt");
  }
  </code></pre>