let values = []
cy.visit(url)
cy.get('selector')
  .find('td')
  .each(($el, $index) => {
    cy.wrap($el)
      .invoke('text')
      .then(text => {
        if ($index!==0) {
          values.push(text.trim())
        }
      })
  })
 .then(() => expect(values).to.deep.eq.(["Value1", "Value2", "Value3", "Value4"])
I tried to print all values for example in the row the values are aaray[0] value1, aaray[1] value2, aaray[2] value3, aaray[3] value4. While executing above only the values 1, 2, 3 are displayed array[0] value is not showing, how to assert all the 4 values
                        
You would get all the values if you removed the
if().