Create an array of unique values, in order, from the input arrays
TypeScript
79
26 commits
updated Sep 18, 2026
Create an array of unique values, in order, from the input arrays
$ npm install array-union
import arrayUnion from 'array-union';
arrayUnion([1, 1, 2, 3], [2, 3]);
//=> [1, 2, 3]
arrayUnion(['foo', 'foo', 'bar']);
//=> ['foo', 'bar']
arrayUnion(['π±', 'π¦', 'π»'], ['π¦', 'π']);
//=> ['π±', 'π¦', 'π»', 'π']
arrayUnion(['π±', 'π¦'], ['π»', 'π¦'], ['πΆ', 'π', 'π']);
//=> ['π±', 'π¦', 'π»', 'πΆ', 'π']
52 followers Β· starred Mar 2021
Create an array of unique values, in order, from the input arrays
TypeScript
79
26 commits
updated Sep 18, 2026
Create an array of unique values, in order, from the input arrays
$ npm install array-union
import arrayUnion from 'array-union';
arrayUnion([1, 1, 2, 3], [2, 3]);
//=> [1, 2, 3]
arrayUnion(['foo', 'foo', 'bar']);
//=> ['foo', 'bar']
arrayUnion(['π±', 'π¦', 'π»'], ['π¦', 'π']);
//=> ['π±', 'π¦', 'π»', 'π']
arrayUnion(['π±', 'π¦'], ['π»', 'π¦'], ['πΆ', 'π', 'π']);
//=> ['π±', 'π¦', 'π»', 'πΆ', 'π']
52 followers Β· starred Mar 2021