Philipp Partosch 46a936d7de added all files to project | 2 years ago | |
---|---|---|
.. | ||
index.d.ts | 2 years ago | |
index.js | 2 years ago | |
license | 2 years ago | |
package.json | 2 years ago | |
readme.md | 2 years ago |
Create an array of unique values, in order, from the input arrays
$ npm install array-union
const arrayUnion = require('array-union');
arrayUnion([1, 1, 2, 3], [2, 3]);
//=> [1, 2, 3]
arrayUnion(['foo', 'foo', 'bar']);
//=> ['foo', 'bar']
arrayUnion(['๐ฑ', '๐ฆ', '๐ป'], ['๐ฆ', '๐']);
//=> ['๐ฑ', '๐ฆ', '๐ป', '๐']
arrayUnion(['๐ฑ', '๐ฆ'], ['๐ป', '๐ฆ'], ['๐ถ', '๐', '๐']);
//=> ['๐ฑ', '๐ฆ', '๐ป', '๐ถ', '๐']
MIT ยฉ Sindre Sorhus