# remove-array-item

> Given an array, removes specified elements and returns the modified array

Latest version **1.1.1** (published 2016-04-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install remove-array-item
pnpm add remove-array-item
yarn add remove-array-item
bun add remove-array-item
```

## 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.1.1 |
| Published | 2016-04-26 |
| First published | 2016-04-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Dustin Schau |
| Maintainers | dschau |
| Keywords | array, arrays, remove, remove items, remove item |

## Links

- npm: https://www.npmjs.com/package/remove-array-item
- Repository: https://github.com/DSchau/remove-array-item
- Homepage: https://github.com/DSchau/remove-array-item#readme
- Issues: https://github.com/DSchau/remove-array-item/issues
- npm.io page: https://npm.io/package/remove-array-item

## Dependencies (1)

- [lodash.flattendeep](https://npm.io/package/lodash.flattendeep.md) ^4.2.0

## Recent versions

- 1.1.1 (latest) — 2016-04-26
- 1.1.0 — 2016-04-26
- 1.0.3 — 2016-04-18
- 1.0.2 — 2016-04-18
- 1.0.1 — 2016-04-18
- 1.0.0 — 2016-04-18

## README

# remove-array-item

[![Build Status](https://img.shields.io/npm/v/remove-array-item.svg)](https://www.npmjs.com/package/remove-array-item)
[![Build Status](https://travis-ci.org/DSchau/remove-array-item.svg?branch=master)](https://travis-ci.org/DSchau/remove-array-item)
[![David](https://img.shields.io/david/DSchau/remove-array-item.svg)](https://david-dm.org/DSchau/remove-array-item)

A simple utility to (recursively) remove specified item(s) from an array.

## Install

```shell
npm i remove-array-item --save
```

## Usage

### `removeArrayItem(arr, item)`

The module simply exports a function; the first argument is the current array, the next is the item that should be removed from all arrays/nested arrays.

It uses a "naive" `indexOf` implementation, and so does not do any deep equality checks on objects or the like.

### Examples

```javascript
import removeArrayItem from 'remove-array-item';

const arr = removeArrayItem(['red', 'green', ['red', 'blue']], 'red');

// arr will be ['green', ['blue']]
``` 

Aditionally, note that additional arguments can be passed (in sequence), and so multiple items can be removed in one statement, a la the following example:

```javascript
const arr = removeArrayItem(['red', 'green', ['blue']], 'red', 'green');

// arr will be [['blue']]
```

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