last-index-of

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
2
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
2 KB
Returns the position of the last occurrence of an item in an array, or -1 if the item is not included in the array.
1 contributor
Install last-index-of as a package?
Copied
npm i @bit/justin-capalbo.ramda.last-index-of
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
chevron_left
chevron_right
lastIndexOf (
target:*,
xs:Array
) : Number

Returns the position of the last occurrence of an item in an array, or -1 if the item is not included in the array. R.equals is used to determine equality.

Example
R.lastIndexOf(3, [-1,3,3,0,1,2,3,4]); //=> 6
     R.lastIndexOf(10, [1,2,3,4]); //=> -1
Arguments
target: *

The item to find.

xs: Array

The array to search in.

Returns
Number

the index of the target, or -1 if the target is not found.

Help and resources