title: How can i compare arrays in Cypress?
body: <p>I want to compare data present in an array with the data retrieved from a class using .each in cypress?</p>
  
  <p>Using below code i have tried to iterate over the FileType array using below code.</p>
  
  <pre class="lang-js prettyprint-override"><code>const Filetype = ['Access', 'Excel', 'Text/CSV','PDF','JSON','dsdsd'];
  const te = cy.wrap($bodyFind).find('.data-sourcename').should('have.length',6).each(($li) =&gt; { cy.log($li.text()); });
  
  te.each(($text)=&gt; {
  cy.log("Te" + $text); 
  //prints ['Access','Excel','Text/CSV','PDF','JSON','XML'];
  });
  
  // Converted FileType Array to Cypress object using cy.wrap command.
  const cywrap = cy.wrap(Filetype);
        te.each((e1)=&gt;cywrap.each((e2)=&gt; {
        if(e1 == e2) {
           expect(e1).equals(e2);
         }
       }));
  </code></pre>
  
  <p>But the value of e1 and e2 is same.
  expect should fail with 'dsdsd' is equals 'XML'
  whereas it passes with 'dsdsd' is equals 'dsdsd'</p>