Skip to content

Latest commit

History

History
34 lines (20 loc) 路 713 Bytes

File metadata and controls

34 lines (20 loc) 路 713 Bytes

array-union Build Status

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

Install

$ npm install array-union

Usage

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