Question: I need to reverse taking element from array. I have to start from the last one. I can't find any different solution to use in Cypress than jQuery 'reverse' but I have problem to use it. 

Don't work in both way: 

```
 cy.get('.btn-remove.action.delete').reverse().each(($el, index, $list) =>  {
                        cy.get($el).click({force:true})
                       cy.wait(1000)
                })

```

answer from Cypress - TypeError: cy.get(...).reverse is not a function

And 

```
cy.get('.btn-remove.action.delete').invoke('reverse').each(($el, index, $list) =>  {
                        cy.get($el).click({force:true})
                        cy.wait(1000)
                })

```

answer from Cypress - CypressError: Timed out retrying: cy.invoke() errored because the property: 'reverse' does not exist on your subject.

Or maybe there is different way than reverse()?

Answer: 
You can apply `reverse()` like this

```js
cy.get('[data-cy="sections"] > optgroup > option')
  .then($options => $options.get().reverse())
  .each($option => {                                    // reverse order
    ...
  })

```

Note the reverse method is `Array.reverse()` so you need to precede it with jQuery `.get()`.
the eq solution implemented with .each()

```
cy.get('[data-cy="sections"] > optgroup > option').each(
      (_$option, index, $list) => {
        const firstIndex = 0;
        const lastIndex = $list.length - 1;
        const descendingIndex = lastIndex - index;

         cy.wrap($list).eq(descendingIndex).click({force:true})

      }
    );

```

Cons:

* $list: HTMLElement[] instead of JQuery<HTMLElement[]>
	+ We have to use javascript to get access the $list
	+ We cannot use $list[descendingIndex].text() or $list[descendingIndex].val()
	+ Instead we can use $list.innerHTML, $list.[descendingIndex].click() or ($list).value

I recommend to use cy.wrap($list).(cypress command) for actions
and if we need access to some string, number, or value, use javascript to get it from the $list.