# @writetome51/array-get-filtered-results

> Similar to Array.filter(), except it returns array of objects representing each filtered item

Latest version **2.0.2** (published 2018-12-07) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @writetome51/array-get-filtered-results
pnpm add @writetome51/array-get-filtered-results
yarn add @writetome51/array-get-filtered-results
bun add @writetome51/array-get-filtered-results
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2018-12-07 |
| First published | 2018-10-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Steve Thompson |
| Maintainers | writetome51 |
| Keywords | array, manipulation, filter, return, results |

## Links

- npm: https://www.npmjs.com/package/@writetome51/array-get-filtered-results
- Repository: https://github.com/writetome51/array-get-filtered-results
- Homepage: https://github.com/writetome51/array-get-filtered-results#readme
- Issues: https://github.com/writetome51/array-get-filtered-results/issues
- npm.io page: https://npm.io/package/@writetome51/array-get-filtered-results

## Dependencies (2)

- [basic-data-handling](https://npm.io/package/basic-data-handling.md) ~1.0.13
- [value-index-pair-interface](https://npm.io/package/value-index-pair-interface.md) ~1.0.1

## Recent versions

- 2.0.2 (latest) — 2018-12-07
- 2.0.1 — 2018-11-03
- 2.0.0 — 2018-10-26
- 1.0.2 — 2018-10-22
- 1.0.1 — 2018-10-17
- 1.0.0 — 2018-10-16

## README

getFilteredResults(testFunction, array): IValueIndexPair[]

testFunction = function(currentValue, currentIndex?, array?) : return boolean

getFilteredResults is almost exactly like Array.filter(), except it returns array of 
IValueIndexPairs.  
A  IValueIndexPair is this object:   {value: any,  index: integer}  
It contains both the value filtered by the testFunction and its index.



Example:

let arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

let results = getFilteredResults((item) => item > 8, arr);

results is now [{value:9, index:8}, {value:10, index:9}]

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