unify-arrays

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i unify-arrays

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • arthurvr