What are the difference between using these 2 methods for retrieving the first element in a collection?
Taken from the live source code of jQuery 1.7.1:
,first:function(){return this.eq(0)},last:function(){return this.eq(-1)}
So as you suspected .first()
is just a wrapper calling .eq()
.
Conclusion: no difference whatsoever. :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With