jQuery what is faster: selectors or methods?

后端 未结 4 469
-上瘾入骨i
-上瘾入骨i 2020-12-17 22:49

Let\'s say I have $(\'mySelector:first\'); and $(\'mySelector\').first();. Which way is the most efficient? I looked in the source, but still could

4条回答
  •  余生分开走
    2020-12-17 23:13

    In my tests, $('mySelector:first'); is faster than $('mySelector').first();

    You may also be interested in this;

提交回复
热议问题