title: Expected [ ] to be [ ] Jasmine, how to check empty array
body: <p>Getting error while trying to check for empty array. I tried using:</p>
  
  <p>Case 1: By initializing as an array</p>
  
  <pre><code>expect(fixture.componentInstance.dataSource).toBe([]);
  </code></pre>
  
  <p>Case 2: By initializing as an array</p>
  
  <pre><code>let expectedAry = new Array;
  expect(fixture.componentInstance.dataSource).toBe(expectedAry);
  </code></pre>
  
  <p>Both the case have the same error:</p>
  
  <pre><code>Expected [  ] to be [  ].
  </code></pre>
  
  <p>Arrays can also be checked by their length, the following works fine</p>
  
  <pre><code>expect(fixture.componentInstance.dataSource.length).toEqual(0); 
  </code></pre>
  
  <p>0 length is an option, but not sure if that is the right way to check whether an array is empty. Do we have a better option for checking whether an array is empty?</p>