# @extra-array/search

> Finds index of first value passing a test.

Latest version **2.10.19** (published 2022-02-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @extra-array/search
pnpm add @extra-array/search
yarn add @extra-array/search
bun add @extra-array/search
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.10.19 |
| Published | 2022-02-19 |
| First published | 2020-03-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Author | wolfram77@gmail.com |
| Maintainers | wolfram77 |
| Keywords | extra, array, search |

## Links

- npm: https://www.npmjs.com/package/@extra-array/search
- Repository: https://github.com/nodef/extra-array
- Homepage: https://github.com/nodef/extra-array#readme
- Issues: https://github.com/nodef/extra-array/issues
- npm.io page: https://npm.io/package/@extra-array/search

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 2.10.19 (latest) — 2022-02-19
- 2.10.18 — 2021-04-13
- 2.10.17 — 2021-02-05
- 2.10.16 — 2021-02-03
- 2.10.15 — 2021-02-03
- 2.10.14 — 2021-02-02
- 2.10.13 — 2021-02-02
- 2.10.12 — 2021-02-02
- 2.10.11 — 2021-02-02
- 2.10.10 — 2021-02-02
- 2.10.9 — 2020-12-16
- 2.10.8 — 2020-09-14
- 2.10.7 — 2020-06-29
- 2.10.6 — 2020-06-28
- 2.10.5 — 2020-06-28
- … 286 more at https://npm.io/package/@extra-array/search/versions

## README

Finds index of first value passing a test.
[:package:](https://www.npmjs.com/package/@extra-array/search)
[:smiley_cat:](https://github.com/orgs/nodef/packages?repo_name=extra-array)
[:running:](https://npm.runkit.com/@extra-array/search)
[:vhs:](https://asciinema.org/a/332122)
[:moon:](https://www.npmjs.com/package/@extra-array/search.min)
[:scroll:](https://unpkg.com/@extra-array/search/)
[:newspaper:](https://nodef.github.io/extra-array/)
[:blue_book:](https://github.com/nodef/extra-array/wiki/)

> Alternatives: [search], [searchRight], [searchAll].<br>
> Similar: [search], [scan], [find].

> This is part of package [extra-array].

[extra-array]: https://www.npmjs.com/package/extra-array

<br>

```javascript
array.search(x, ft);
// x:  an array
// ft: test function (v, i, x)
// → index of value, -1 if not found
```

```javascript
const array = require("extra-array");

var x = [1, 2, 3, 2, 5];
array.search(x, 2);
// 1        ^

var x = [1, -2, 3, 2, 5];
array.search(x, 2, (a, b) => Math.abs(a) - Math.abs(b));
// 1         ^

var x = [1, -2, 3, 2, 5];
array.search(x, 2, null, v => Math.abs(v));
// 1         ^
```

<br>
<br>


## References

- [List-Extra.elemIndex: elm](https://package.elm-lang.org/packages/elm-community/list-extra/7.1.0/List-Extra#elemIndex)
- [iterable-binsearch: @krisselden](https://www.npmjs.com/package/iterable-binsearch)
- [binarysearch: @soldair](https://www.npmjs.com/package/binarysearch)

[search]: https://github.com/nodef/extra-array/wiki/search
[searchRight]: https://github.com/nodef/extra-array/wiki/searchRight
[searchAll]: https://github.com/nodef/extra-array/wiki/searchAll
[scan]: https://github.com/nodef/extra-array/wiki/scan
[find]: https://github.com/nodef/extra-array/wiki/find

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