# array.prototype.findindex

> Array.prototype.findIndex ES2015 polyfill.

Latest version **2.2.4** (published 2024-12-17) · MIT license · 0 weekly downloads

> **Native alternative:** Array.prototype.findIndex — Use native JavaScript (Node 4.0.0+) (https://developer.mozilla.orgGlobal_Objects/Array/findIndex)

## Install

```sh
npm install array.prototype.findindex
pnpm add array.prototype.findindex
yarn add array.prototype.findindex
bun add array.prototype.findindex
```

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.4 |
| Published | 2024-12-17 |
| First published | 2013-12-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.4 |
| Dependencies | 6 |
| Unpacked size | 19.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 27 |
| Author | Paul Miller |
| Maintainers | paulmillr, ljharb |
| Keywords | Array.prototype.findIndex, findIndex, es6, es2015 |

## Links

- npm: https://www.npmjs.com/package/array.prototype.findindex
- Repository: https://github.com/paulmillr/Array.prototype.findIndex
- Homepage: https://github.com/paulmillr/Array.prototype.findIndex#readme
- Issues: https://github.com/paulmillr/Array.prototype.findIndex/issues
- npm.io page: https://npm.io/package/array.prototype.findindex

## Dependencies (6)

- [call-bind](https://npm.io/package/call-bind.md) ^1.0.8
- [call-bound](https://npm.io/package/call-bound.md) ^1.0.3
- [es-abstract](https://npm.io/package/es-abstract.md) ^1.23.6
- [es-object-atoms](https://npm.io/package/es-object-atoms.md) ^1.0.0
- [define-properties](https://npm.io/package/define-properties.md) ^1.2.1
- [es-shim-unscopables](https://npm.io/package/es-shim-unscopables.md) ^1.0.2

## Recent versions

- 2.2.4 (latest) — 2024-12-17
- 2.2.3 — 2024-03-17
- 2.2.2 — 2023-08-27
- 2.2.1 — 2022-11-02
- 2.2.0 — 2022-04-12
- 2.1.1 — 2022-04-10
- 2.1.0 — 2020-02-24
- 2.0.2 — 2017-03-30
- 2.0.1 — 2017-03-30
- 2.0.0 — 2016-01-31
- 1.0.0 — 2014-08-14
- 0.1.1 — 2014-03-24
- 0.1.0 — 2013-12-20

## README

# ES6 `Array.prototype.findIndex` polyfill

Simple ES6 [Array.prototype.findIndex](http://people.mozilla.org/%7Ejorendorff/es6-draft.html#sec-array.prototype.findindex) polyfill for older environments taken from [es6-shim](https://github.com/paulmillr/es6-shim).

For browsers and node.js.

## Installation
* Just include repo before your scripts.
* `npm install array.prototype.findindex` if you’re using node.js.
* `component install paulmillr/Array.prototype.findIndex` if you’re using [component(1)](https://github.com/component/component).
* `bower install Array.prototype.findIndex` if you’re using [Twitter Bower](http://bower.io).


## Usage

* `Array.prototype.findIndex(predicate[, thisArg])` returns first item index that matches `predicate` function.
* `predicate(value, index, collection)`: takes three arguments
    * `value`: current collection element
    * `index`: current collection element index
    * `collection`: the collection

```javascript
var findIndex = require('array.prototype.findindex');

findIndex.shim(); // if you want to install it on the global environment
```

Code example:

```javascript
// Default:
[1, 5, 10, 15].findIndex(function(a) {return a > 9;}) // 2
```

## License

The MIT License (MIT)

Copyright (c) 2013 Paul Miller <http://paulmillr.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

---
_Source: https://npm.io/package/array.prototype.findindex · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
