UNPKG

686 BMarkdownView Raw
1# array-find-index [![Build Status](https://travis-ci.org/sindresorhus/array-find-index.svg?branch=master)](https://travis-ci.org/sindresorhus/array-find-index)
2
3> ES2015 [`Array#findIndex()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) [ponyfill](https://ponyfill.com)
4
5
6## Install
7
8```
9$ npm install --save array-find-index
10```
11
12
13## Usage
14
15```js
16const arrayFindIndex = require('array-find-index');
17
18arrayFindIndex(['rainbow', 'unicorn', 'pony'], x => x === 'unicorn');
19//=> 1
20```
21
22
23## API
24
25Same as `Array#findIndex()`, but with the input array as the first argument.
26
27
28## License
29
30MIT © [Sindre Sorhus](https://sindresorhus.com)