.eq() vs :nth-child(), which one to choose? #30213
Unanswered
bunnyxt
asked this question in
Questions and Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello guys, I'm writing tests for checking the item inside a list and find
.eq()
and:nth-child()
both works, see example.Which one should I choose?
My assumption (please correct me if I'm wrong, thanks):
.eq()
is more straightforward but chained with.find()
will be less efficient.:nth-child()
is less readable but faster.Beta Was this translation helpful? Give feedback.
All reactions