_.lastIndexOf(获取元素的索引值)
Last updated
Was this helpful?
Last updated
Was this helpful?
语法:
源代码链接:
npm包链接:
描述:
这个方法类似,区别是它是从右到左遍历array
的元素。
开始版本:0.1.0
参数:
array (Array)
: 要搜索的数组。
value (*)
: 要搜索的值。
[fromIndex=array.length-1] (number)
: 开始搜索的索引值。
返回值:
(number)
: 返回匹配值的索引值,否则返回 -1。
例子: