# remove-array-items

> remove items from a javascript array without generating memory garbage

Latest version **3.0.0** (published 2021-03-31) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2021-03-31 |
| First published | 2017-04-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=12.17 |
| Dependencies | 0 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 34 |
| Author | Mike Reinstein |
| Maintainers | mreinstein |
| Keywords | array, splice, remove, nogarbage, gcfriendly |

## Links

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

## Recent versions

- 3.0.0 (latest) — 2021-03-31
- 2.0.1 — 2019-10-23
- 2.0.0 — 2018-12-13
- 1.1.1 — 2018-12-12
- 1.1.0 — 2018-11-15
- 1.0.0 — 2017-04-27
- 0.0.1 — 2017-04-16

## README

# remove-array-items

remove items from a javascript array without generating memory garbage.

[![Build Status](https://travis-ci.org/mreinstein/remove-array-items.svg?branch=master)](https://travis-ci.org/mreinstein/remove-array-items)

Despite there being a number of "remove array items" in npm, I couldn't find satisfying all criteria:

* **doesn't generate garbage**
* **performs similar or better to the native `array.splice`**
* has tests
* is a pure es module

so here we are.

originally inspired by https://gamealchemist.wordpress.com/2013/05/01/lets-get-those-javascript-arrays-to-work-fast/

(which is a gold mine for performant, non-garbage generating array operations by the way.)


## usage

```javascript
import removeItems from 'remove-array-items'


const arr = [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]

const startIdx = 3    // integer >= 0
const removeCount = 4 // int >= 0

removeItems(arr, startIdx, removeCount)  // after running, arr === [ 1, 2, 3, 8, 9 ]
```

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