1.0.0 • Published 9 years ago

unify-arrays v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

unify-arrays

Squashes arrays together, while making sure there aren't any duplicate values.

Build Status

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']