💡 What will happen after passing negative number to the
.its() method?
cy.wrap(['JS', 'TS']).its(-1).should('eq', 'TS')
A | Assertion will pass
B | AssertionError, expected JS to equal TS
C | AssertionError, expected undefined to equal TS
D | AssertionError, -1 is not a valid index
🎉 Quiz Completed! 🎉
The
.its() command is used to access properties of the subject.
So, in this case, it will try to access the property at index
-1
which is
undefined
.