# @extra-array/head

> Gets first value.

Latest version **2.10.19** (published 2022-02-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @extra-array/head
pnpm add @extra-array/head
yarn add @extra-array/head
bun add @extra-array/head
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.10.19 |
| Published | 2022-02-19 |
| First published | 2020-03-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Author | wolfram77@gmail.com |
| Maintainers | wolfram77 |
| Keywords | extra, array, head |

## Links

- npm: https://www.npmjs.com/package/@extra-array/head
- Repository: https://github.com/nodef/extra-array
- Homepage: https://github.com/nodef/extra-array#readme
- Issues: https://github.com/nodef/extra-array/issues
- npm.io page: https://npm.io/package/@extra-array/head

## Recent versions

- 2.10.19 (latest) — 2022-02-19
- 2.10.18 — 2021-04-13
- 2.10.17 — 2021-02-05
- 2.10.16 — 2021-02-03
- 2.10.15 — 2021-02-03
- 2.10.14 — 2021-02-02
- 2.10.13 — 2021-02-02
- 2.10.12 — 2021-02-02
- 2.10.11 — 2021-02-02
- 2.10.10 — 2021-02-02
- 2.10.9 — 2020-12-16
- 2.10.8 — 2020-09-14
- 2.10.7 — 2020-06-29
- 2.10.6 — 2020-06-28
- 2.10.5 — 2020-06-28
- … 372 more at https://npm.io/package/@extra-array/head/versions

## README

Gets first value.
[:package:](https://www.npmjs.com/package/@extra-array/head)
[:smiley_cat:](https://github.com/orgs/nodef/packages?repo_name=extra-array)
[:running:](https://npm.runkit.com/@extra-array/head)
[:vhs:](https://asciinema.org/a/332061)
[:moon:](https://www.npmjs.com/package/@extra-array/head.min)
[:scroll:](https://unpkg.com/@extra-array/head/)
[:newspaper:](https://nodef.github.io/extra-array/)
[:blue_book:](https://github.com/nodef/extra-array/wiki/)

> Similar: [head], [tail], [init], [last].

> This is part of package [extra-array].

[extra-array]: https://www.npmjs.com/package/extra-array

<br>

```javascript
array.head(x, [vd]);
// x:  an array
// vd: default value
```

```javascript
const array = require("extra-array");

array.head([1, 2, 3]);
// 1

array.head([], -1);
// -1
```

<br>
<br>


## References

- [Data.List.head: Haskell](https://hackage.haskell.org/package/base-4.12.0.0/docs/Data-List.html#v:head)
- [_.head: lodash](https://lodash.com/docs/4.17.15#head)
- [Array.first: sugarjs](https://sugarjs.com/docs/#/Array/first)

[head]: https://github.com/nodef/extra-array/wiki/head
[tail]: https://github.com/nodef/extra-array/wiki/tail
[init]: https://github.com/nodef/extra-array/wiki/init
[last]: https://github.com/nodef/extra-array/wiki/last

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