# array-find

> ES6 Array.find ponyfill. Return the first array element which satisfies a testing function.

Latest version **1.0.0** (published 2015-05-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install array-find
pnpm add array-find
yarn add array-find
bun add array-find
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-05-21 |
| First published | 2014-03-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 29 |
| Author | Stefan Duberg |
| Maintainers | dubban |
| Keywords | array, find, ponyfill, polyfill, es6, es2015, es 2015 |

## Links

- npm: https://www.npmjs.com/package/array-find
- Repository: https://github.com/stefanduberg/array-find
- Issues: https://github.com/stefanduberg/array-find/issues
- npm.io page: https://npm.io/package/array-find

## Recent versions

- 1.0.0 (latest) — 2015-05-21
- 0.1.1 — 2014-03-24
- 0.1.0 — 2014-03-12
- 0.0.1 — 2014-03-12

## README

# array-find

[![Build Status](https://travis-ci.org/stefanduberg/array-find.svg?branch=master)](https://travis-ci.org/stefanduberg/array-find)

**ES 2015 `Array.find` ponyfill.**

**Ponyfill: A polyfill that doesn't overwrite the native method.**

Find array elements. Executes a callback for each element, returns the first element for which its callback returns a truthy value.

## Usage

```javascript
var find = require('array-find');
var numbers = [1, 2, 3, 4];

find(numbers, function (element, index, array) {
  return element === 2;
});
// => 2

var robots = [{name: 'Flexo'}, {name: 'Bender'}, {name: 'Buster'}];

find(robots, function (robot, index, array) {
  return robot.name === 'Bender';
});
// => {name: 'Bender'}

find(robots, function (robot, index, array) {
  return robot.name === 'Fry';
});
// => undefined
```

Optionally pass in an object as third argument to use as `this` when executing callback.

## Install

```bash
$ npm install array-find
```

## License
MIT

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