find-last
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

find-last Travis CI Build Status

Like Array#find but searches the array backwards.

NPM Badge

Install

npm install find-last

Usage

const findLast = require("find-last");

findLast(["a", "b", "bba", "cc", "d"], value => value.includes("a"));
//=> "bba"

API

findLast(array, predicate)

array

Type: array

The array to search.

predicate

Type: (item, index, array) => boolean

The predicate function to call on each item.

Readme

Keywords

Package Sidebar

Install

npm i find-last

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

3.09 kB

Total Files

6

Last publish

Collaborators

  • richienb