array-find-index
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/array-find-index package

1.0.2 • Public • Published

array-find-index Build Status

ES2015 Array#findIndex() ponyfill

Install

$ npm install --save array-find-index

Usage

const arrayFindIndex = require('array-find-index');
 
arrayFindIndex(['rainbow', 'unicorn', 'pony'], x => x === 'unicorn');
//=> 1

API

Same as Array#findIndex(), but with the input array as the first argument.

License

MIT © Sindre Sorhus

Package Sidebar

Install

npm i array-find-index

Weekly Downloads

4,813,080

Version

1.0.2

License

MIT

Last publish

Collaborators

  • sindresorhus