find:返回数组中的第一个匹配值

时间:2021-06-14 07:09:42
【文件属性】:
文件名称:find:返回数组中的第一个匹配值
文件大小:3KB
文件格式:ZIP
更新时间:2021-06-14 07:09:42
JavaScript 找 查找数组中的第一个匹配值。 安装 $ component install component/find 应用程序接口 查找(数组,fn) 用函数查找: var tobi = find ( users , function ( u ) { return u . name == 'Tobi' } ) ; 查找(数组,字符串) 使用属性字符串查找: find ( users , 'admin' ) ; 查找(数组,对象) 使用对象值匹配查找: var users = [ ] ; users . push ( { name : 'Tobi' , age : 2 , species : 'ferret' } ) ; users . push ( { name : 'Jane' , age : 6 , species : 'ferret' } ) ; users . push
【文件预览】:
find-master
----index.js(784B)
----package.json(429B)
----test()
--------index.js(1KB)
----component.json(320B)
----Readme.md(749B)
----.gitignore(30B)
----History.md(192B)
----Makefile(232B)

网友评论