Despite numerous tutorials, I am still struggling to grasp this concept. To practice, I am currently working on where I am attempting to retrieve a list of elements and compare it to another list to ensure accuracy. I plan to do the same after sorting from Z to A, as well as by price. However, being fairly new to this, I am finding it quite challenging. So far, I have only managed to obtain the list and reverse it (?)
const array1 = $$('.inventory_item_name').forEach(element => {
console.log(element.getText())
});
const array2 = $$('.inventory_item_name').reverse().forEach(element => {
console.log(element.getText())
});
When attempting to compare these lists using ===, they turn out to be true :/ I am experimenting with this in VScode -Js - webdriverIO - Mocha