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

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

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 in your project
npm i @bit/bit.ramda.utils.find-last
Copied

findLast (fn:Function, list:Array) : Object

Returns the last element of the list which matches the predicate, or undefined 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.findLast(R.propEq('a', 1))(xs); //=> {a: 1, b: 1}
     R.findLast(R.propEq('a', 4))(xs); //=> undefined

Arguments

fn: Function

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

list: Array

The array to consider.

Returns

Object

The element found, or `undefined`.