2024-10-15 23:05:53 +03:00

35 lines
713 B
Markdown

# array-union [![Build Status](https://travis-ci.org/sindresorhus/array-union.svg?branch=master)](https://travis-ci.org/sindresorhus/array-union)
> Create an array of unique values, in order, from the input arrays
## Install
```
$ npm install array-union
```
## Usage
```js
const arrayUnion = require('array-union');
arrayUnion([1, 1, 2, 3], [2, 3]);
//=> [1, 2, 3]
arrayUnion(['foo', 'foo', 'bar']);
//=> ['foo', 'bar']
arrayUnion(['馃惐', '馃', '馃惢'], ['馃', '馃寛']);
//=> ['馃惐', '馃', '馃惢', '馃寛']
arrayUnion(['馃惐', '馃'], ['馃惢', '馃'], ['馃惗', '馃寛', '馃寛']);
//=> ['馃惐', '馃', '馃惢', '馃惗', '馃寛']
```
## License
MIT 漏 [Sindre Sorhus](https://sindresorhus.com)