title: Typescript error: Argument of type 'Object' is not assignable to parameter of type '{}[]'
body: <p>I'm using the <a href="https://material.angular.io/components/table/overview" rel="nofollow noreferrer">Angular Material table component</a> like so:</p>
  
  <pre><code>    this.userService.getUsers().subscribe((response) =&gt; {
          this.users = new MatTableDataSource(response);
      });
  </code></pre>
  
  <p>It works but when compiling it throws the following typescript error:</p>
  
  <blockquote>
    <p>Argument of type 'Object' is not assignable to parameter of type
    '{}[]'. The 'Object' type is assignable to very few other types. Did
    you mean to use the 'any' type instead? Property 'includes' is missing
    in type 'Object'.</p>
  </blockquote>
  
  <p>So I tried changing it to:</p>
  
  <pre><code>this.users = new MatTableDataSource&lt;any&gt;(response);
  </code></pre>
  
  <p>But still same error. <code>response</code> looks like this:</p>
  
  <pre><code>[{
      userId: 123,
      username: 'Tom'
  }, {
      userId: 456,
      username: 'Joe'
  }]
  </code></pre>
  
  <p>Any idea how to get rid of the error?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Should mention if I do this:</p>
  
  <pre><code>this.users = new MatTableDataSource([response]);
  </code></pre>
  
  <p>the error goes away but then the table doesn't work because the format isn't the right one that's expected by the table. Just noting this in case it sheds any light as to what may be the cause... </p>