Are jQuery's :first and :eq(0) selectors functionally equivalent?

前端 未结 3 1717
礼貌的吻别
礼貌的吻别 2020-12-17 14:27

I\'m not sure whether to use :first or :eq(0) in a selector. I\'m pretty sure that they\'ll always return the same object, but is one speedier than the other?

I\'m

3条回答
  •  温柔的废话
    2020-12-17 15:14

    Yes they are equivalent.

    No they aren't likely to be significantly different (anything else is micro-optimization).

提交回复
热议问题