# @writetome51/array-get-and-remove-filtered-results

> Receives a test function and both removes and returns resulting items that pass test.

Latest version **2.0.5** (published 2018-12-06) · MIT license · 0 weekly downloads

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

## Install

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

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.5 |
| Published | 2018-12-06 |
| First published | 2018-10-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 12.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Steve Thompson |
| Maintainers | writetome51 |
| Keywords | array, manipulation, filter, remove, return, items |

## Links

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

## Dependencies (5)

- [array-pluck](https://npm.io/package/array-pluck.md) ^1.0.0
- [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
- [@writetome51/array-remove-by-indexes](https://npm.io/package/@writetome51/array-remove-by-indexes.md) ~1.0.0
- [@writetome51/array-get-filtered-results](https://npm.io/package/@writetome51/array-get-filtered-results.md) ~2.0.1

## Recent versions

- 2.0.5 (latest) — 2018-12-06
- 2.0.4 — 2018-11-03
- 2.0.3 — 2018-10-31
- 2.0.2 — 2018-10-31
- 2.0.1 — 2018-10-27
- 2.0.0 — 2018-10-27
- 1.0.3 — 2018-10-22
- 1.0.2 — 2018-10-19
- 1.0.1 — 2018-10-17
- 1.0.0 — 2018-10-14

## README

This function removes array items if they pass a test-function, and   
returns an array of IValueIndexPairs.  
A IValueIndexPair is this object: {value: any,  index: integer}

getAndRemoveFilteredResults(testFunction, array):  IValueIndexPair[]

testFunction = function(item, index?, array?): boolean

Example:

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

let removed = getAndRemoveFilteredResults((item) => item < 3,  arr);

removed is now [ {value:1, index:0}, {value:2, index:1} ]

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