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

1.0.0 • Public • Published

find-last-index Travis CI Build Status

Like Array#findIndex but searches the array backwards.

NPM Badge

Install

npm install find-last-index

Usage

const findLastIndex = require("find-last-index");
 
findLastIndex(["a", "b", "bba", "cc", "d"], value => value.includes("a"));
//=> 2

API

findLastIndex(array, predicate)

array

Type: array

The array to search.

predicate

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

The predicate function to call on each item.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    11
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    11
  • 0.0.0
    1

Package Sidebar

Install

npm i find-last-index

Weekly Downloads

12

Version

1.0.0

License

MIT

Unpacked Size

3.39 kB

Total Files

6

Last publish

Collaborators

  • richienb