使用.first()和.eq(0)有什么区别? [英] What are the differences between using .first() and .eq(0)?

查看:169
本文介绍了使用.first()和.eq(0)有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用这两种方法检索集合中的第一个元素有什么区别?

What are the difference between using these 2 methods for retrieving the first element in a collection?

推荐答案

来自所以您怀疑.first()只是一个调用.eq()的包装器.

So as you suspected .first() is just a wrapper calling .eq().

结论:没有任何区别. :)

Conclusion: no difference whatsoever. :)

这篇关于使用.first()和.eq(0)有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆