blob: 31663411c3120779036a733fab57ba8143944631 [file] [log] [blame] [view]
Yang Guo4fd355c2019-09-19 08:59:031# 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)