# array-union

> Create an array of unique values, in order, from the input arrays

Latest version **3.0.1** (published 2021-03-01) · MIT license · 0 weekly downloads

> **Better alternative:** Use [...new Set([...a, ...b])] — Consider using a lighter alternative

## Install

```sh
npm install array-union
pnpm add array-union
yarn add array-union
bun add array-union
```

## 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.1 |
| Published | 2021-03-01 |
| First published | 2014-06-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 79 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | array, set, uniq, unique, duplicate, remove, union, combine, merge |

## Links

- npm: https://www.npmjs.com/package/array-union
- Repository: https://github.com/sindresorhus/array-union
- Homepage: https://github.com/sindresorhus/array-union#readme
- Issues: https://github.com/sindresorhus/array-union/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/array-union

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 3.0.1 (latest) — 2021-03-01
- 3.0.0 — 2021-03-01
- 2.1.0 — 2019-04-22
- 2.0.0 — 2019-03-20
- 1.0.2 — 2016-06-16
- 1.0.1 — 2014-11-18
- 1.0.0 — 2014-08-13
- 0.1.0 — 2014-06-19

## README

# array-union

> Create an array of unique values, in order, from the input arrays

## Install

```
$ npm install array-union
```

## Usage

```js
import arrayUnion from 'array-union';

arrayUnion([1, 1, 2, 3], [2, 3]);
//=> [1, 2, 3]

arrayUnion(['foo', 'foo', 'bar']);
//=> ['foo', 'bar']

arrayUnion(['🐱', '🦄', '🐻'], ['🦄', '🌈']);
//=> ['🐱', '🦄', '🐻', '🌈']

arrayUnion(['🐱', '🦄'], ['🐻', '🦄'], ['🐶', '🌈', '🌈']);
//=> ['🐱', '🦄', '🐻', '🐶', '🌈']
```

---

<div align="center">
	<b>
		<a href="https://tidelift.com/subscription/pkg/npm-array-union?utm_source=npm-array-union&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
	</b>
	<br>
	<sub>
		Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
	</sub>
</div>

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