title: JavaScript splitting a file content into key value pairs
body: <p>I have the below UploadDocument event which has fileReader.result which logs below message to the console</p>
  
  <p><strong>Output in the Console</strong></p>
  
  <pre><code>A,B
  aa,dsf
  adfa,dfsd
  fdsafds,sdf
  
   uploadDocument(file) {
      let fileReader = new FileReader();
       fileReader.onload =(e) =&gt; {
        console.log(fileReader.result);
      }  
      fileReader.readAsText(this.file);
  </code></pre>
  
  <p>How can I split the above content (A,B...) in the console into a key value pairs ( Like a hashmap or Arraylist ) using javascript or Typescript?</p>
  
  <p>I have tried splitting it
    var lines = fileReader.result.split(/[\r\n]+/g); 
        console.log(lines);</p>
  
  <p>Now how can I create A hashmap from this?</p>