# @writetome51/array-get-and-remove-head-tail

> These functions remove and return items from the beginning and end of the array, respectively

Latest version **3.0.0** (published 2021-05-02) · MIT license · 0 weekly downloads

## Install

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

## 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-05-02 |
| First published | 2018-10-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Steve Thompson |
| Maintainers | writetome51 |
| Keywords | array, manipulation, get, remove, beginning, end, elements, items |

## Links

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

## Dependencies (1)

- [@writetome51/array-get-and-remove-adjacent-at](https://npm.io/package/@writetome51/array-get-and-remove-adjacent-at.md) >=2.0.0

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2021-05-02
- 2.0.0 — 2020-08-05
- 1.0.5 — 2019-04-15
- 1.0.4 — 2019-02-24
- 1.0.3 — 2018-12-05
- 1.0.2 — 2018-11-06
- 1.0.1 — 2018-10-22
- 1.0.0 — 2018-10-13

## README

# getAndRemoveHead\<T\>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;numItems,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array: T[]<br>): T[]

Removes and returns `numItems` from beginning of `array`.

# getAndRemoveTail\<T\>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;numItems,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array: T[]<br>): T[]

Removes and returns `numItems` from end of `array`.


## Examples
```
let arr = ['jim', 'todd', 'tony', 'barry', 'jill'];
let firstTwo = getAndRemoveHead(2, arr);

// firstTwo is ['jim', 'todd'] .
// arr is now ['tony', 'barry', 'jill'] .


let arr = ['jim', 'todd', 'tony', 'barry', 'jill'];
let lastThree = getAndRemoveTail(3, arr);

// lastThree is [ 'tony', 'barry', 'jill'] .
// arr is now ['jim', 'todd'] .
```


## Installation
`npm i @writetome51/array-get-and-remove-head-tail`

## Loading
```js
import {getAndRemoveHead, getAndRemoveTail} 
    from '@writetome51/array-get-and-remove-head-tail';
```

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