Share your code. Components are building blocks, you are the architect.

utils/find-last-index
v1.1.0
1.1.0
1.0.0
MIT
PUBLIC
3
Build: fail
BuildFail
Build Status: fail
Returns the index of the last element of the list which matches the

Please configure Bit as a scoped registry to install components with NPM.Learn more

npm config set '@bit:registry' https://node.bitsrc.io
Use utils/find-last-index in your project
npm i @bit/bit.ramda.utils.find-last-index
Copied

findLastIndex (fn:Function, list:Array) : Number

Returns the index of the last element of the list which matches the predicate, or -1 if no element matches.

Acts as a transducer if a transformer is given in list position.

Example

var xs = [{a: 1, b: 0}, {a:1, b: 1}];
     R.findLastIndex(R.propEq('a', 1))(xs); //=> 1
     R.findLastIndex(R.propEq('a', 4))(xs); //=> -1

Arguments

fn: Function

The predicate function used to determine if the element is the desired one.

list: Array

The array to consider.

Returns

Number

The index of the element found, or `-1`.