💡 What will happen when passing negative number to the
.eq() method?
cy.get('li').eq(-1)
A | Error, negative numbers cannot be used
B | Yield an element from the beginning
C | Yield an element from the end
🎉 Quiz Completed! 🎉
The querying behavior of this command matches exactly how
.eq() works in
jQuery.
So, if the index is negative, it will count backwards from the last element.