title: Property 'split' does not exist on type 'ArrayBuffer' in angular
body: <p>I was trying to read a CSV file using Filereader and want to convert the content into an array. I was able to get the CSV file properly, but whenever I want to convert the content of CSV file into an array I have this error.</p>
  
  <hr>
  
  <p>Why do I have this error and how can i solve it?</p>
  
  <pre><code>
      ERROR in src/app/app.component.ts(31,10): error TS2314: Generic type 'Array&lt;T&gt;' requires 1 type argument(s).
          src/app/app.component.ts(31,21): error TS2339: Property 'split' does not exist on type 'string | ArrayBuffer'.
            Property 'split' does not exist on type 'ArrayBuffer'.
  </code></pre>
  
  <hr>
  
  <p>Here is my app.component.html file:</p>
  
  <pre><code>    &lt;nav class="navbar navbar-light bg-light"&gt;
        &lt;a class="navbar-brand" href="#"&gt;
          &lt;img src="/docs/4.0/assets/brand/bootstrap-solid.svg" width="30" height="30" class="d-inline-block align-top"
            alt=""&gt;
          Floor Plan
        &lt;/a&gt;
      &lt;/nav&gt;
  
      &lt;div class="card m-5"&gt;
        &lt;div class="row row-5"&gt;
          &lt;div class="col-4"&gt;
            &lt;div class="input-group"&gt;
              &lt;div class="custom-file"&gt;
                &lt;input type="file" class="custom-file-input" id="inputGroupFile04" (change)="upload($event.target)"&gt;
                &lt;label class="custom-file-label" for="inputGroupFile04"&gt;Choose file&lt;/label&gt;
              &lt;/div&gt;
              &lt;div class="input-group-append"&gt;
                &lt;button class="btn btn-outline-secondary" type="button" class="btn btn-primary btn-sm"&gt;Upload &lt;/button&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class="col-8 border border-primary" &gt;
            {{csvContent}}
  
          &lt;/div&gt;
  
        &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <hr>
  
  <p>here is my app.component.ts file:</p>
  
  <pre><code>    export class AppComponent {
        fileToUpload: File = null;
        title = 'floor-plan';
        csvContent: string[] = []
  
  
  
        upload(input: HTMLInputElement) {
  
          const files = input.files;
          var content = this.csvContent;
  
          if (files &amp;&amp; files.length) {
  
            const fileToRead = files[0];
  
            const fileReader = new FileReader();
            fileReader.onload = (event) =&gt; {
              this.csvContent = (event.target as FileReader).result.split('\n').map((data) =&gt; {
                return data.split(',')
              })
  
            }
  
            fileReader.readAsText(fileToRead, "UTF-8");
          }
  
        }
       }
  </code></pre>