_.findLastIndex(查找元素的索引值)
Last updated
Was this helpful?
Last updated
Was this helpful?
语法:
源代码链接:
npm包链接:
描述:
这个方法类似于。除了它从右到左遍历集合的元素。
开始版本:2.0.0
参数:
array (Array)
: 需要检索的数组。
[predicate=_.identity] (Function)
: 每个迭代函数调用。
[fromIndex=array.length-1] (number)
: 开始搜索的索引值。
返回值:
(number)
: 返回查找到的元素索引值,否则f返回 -1
。
例子:
注意:不同的方式代表:_.matches
,_.matchesProperty
,_.property
的简写法