title: How to compare a list of elements from the web, locally?
body: <p>There are many tutorials but just can't figure it out... So i am practicing on <a href="https://www.saucedemo.com/inventory.html" rel="nofollow noreferrer">https://www.saucedemo.com/inventory.html</a> and trying to get the list of elements, and compare it to a list, to see that it is ok. Will do the same after sorting Z to A, and same with price. But i am quite a noob and beginner and really struggling. Until now i managed to get the list and reverse it (?)</p>
  <pre><code>const array1 = $$('.inventory_item_name').forEach(element =&gt; {
              console.log(element.getText())
          });
  const array2 = $$('.inventory_item_name').reverse().forEach(element =&gt; {
              console.log(element.getText())
          });
  </code></pre>
  <p>If i try to compare these with === it will be true :/ i am trying it in VScode -Js - webdriverIO - Mocha</p>