# @writetome51/array-remove-all-of-first-of

> Functions that search for instances of a value in an array and remove them.

Latest version **3.0.0** (published 2021-11-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @writetome51/array-remove-all-of-first-of
pnpm add @writetome51/array-remove-all-of-first-of
yarn add @writetome51/array-remove-all-of-first-of
bun add @writetome51/array-remove-all-of-first-of
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2021-11-14 |
| First published | 2018-09-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Steve Thompson |
| Maintainers | writetome51 |
| Keywords | array, manipulation, remove, value, all, instances, first, instance |

## Links

- npm: https://www.npmjs.com/package/@writetome51/array-remove-all-of-first-of
- Repository: https://github.com/writetome51/array-remove-all-of-first-of
- Homepage: https://github.com/writetome51/array-remove-all-of-first-of#readme
- Issues: https://github.com/writetome51/array-remove-all-of-first-of/issues
- npm.io page: https://npm.io/package/@writetome51/array-remove-all-of-first-of

## Dependencies (3)

- [@writetome51/array-has](https://npm.io/package/@writetome51/array-has.md) >=3.0.0
- [@writetome51/array-get-indexes-of](https://npm.io/package/@writetome51/array-get-indexes-of.md) >=2.0.1
- [@writetome51/array-remove-by-index](https://npm.io/package/@writetome51/array-remove-by-index.md) >=2.0.0

## Recent versions

- 3.0.0 (latest) — 2021-11-14
- 2.0.0 — 2020-08-14
- 1.0.6 — 2019-02-26
- 1.0.5 — 2018-11-17
- 1.0.4 — 2018-11-08
- 1.0.3 — 2018-10-25
- 1.0.2 — 2018-10-22
- 1.0.1 — 2018-10-19
- 1.0.0 — 2018-09-28

## README

# removeFirstOf\<T\>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value: T,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array: T[]<br>): void

Removes the first instance of `value` from `array`.

# removeAllOf\<T\>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value: T,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array: T[]<br>): void

Removes all instances of `value` from `array`.

# removeAllOfEach\<T\>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;values: T[],<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array: T[]<br>): void

Removes all instances of each value in `values` from `array`.

All the functions use identical `===` to find matches, except when the
value being search for is an array. Arrays must only have identical
content to be a match (see examples).

## Examples
```js
let arr = ['a', 'b', 'c', 'a', 'b', 'c'];
removeFirstOf('c', arr);
// arr is now ['a', 'b', 'a', 'b', 'c']

arr = ['a', 'b', 'c', 'a', 'b', 'c'];
removeAllOf('c', arr);
// arr is now ['a', 'b', 'a', 'b']

arr = ['a', 'b', 'c', 1, 2, 3, 'a', 'b', 'c'];
removeAllOfEach(['a', 'b', 'c'], arr);
// arr is now [1, 2, 3]

const obj = {name: 'steve'};
arr = [obj, {name: 'steve'}];
removeAllOf(obj, arr);
// arr is now [{name: 'steve'}]

// All the functions use identical `===` to find matches, except when the 
// value being search for is an array. Arrays must only have identical 
// content to be a match:

arr = [[1,2], [3,4], [1,2]];
removeFirstOf([1,2], arr);
// arr is now [ [3,4], [1,2] ]

const obj = {name: 'steve'};
arr = [ [obj], [{name: 'steve'}] ];
removeAllOf([obj], arr);
// arr is now [ [{name: 'steve'}] ]
```

## Installation
`npm i  @writetome51/array-remove-all-of-first-of'`


## Loading
```js
import {removeFirstOf, removeAllOf, removeAllOfEach} 
    from '@writetome51/array-remove-all-of-first-of';
```

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