unify-arrays
v1.0.0
Published
Squashes arrays together, while making sure there aren't any duplicate values
Downloads
2
Maintainers
Readme
unify-arrays
Squashes arrays together, while making sure there aren't any duplicate values.
Installation
$ npm install unify-arrays --save-dep
Example
var unifyArrays = require('unify-arrays');
// Simple concatination of two arrays
unifyArrays([1, 2], [3, 4]); // [1, 2, 3, 4]
// ... but it can perfectly take more than 2!
unifyArrays([1, 2], [3, 4], [5, 6]); // [1, 2, 3, 4, 5, 6]
// and removes duplicates!
unifyArrays(['a', 'b'], ['b'], ['c', 'c', 'c'], ['d', 'e'], ['f']); // ['a', 'b', 'c', 'd', 'e', 'f']