1.0.0 • Published 8 years ago

a-union v1.0.0

Weekly downloads
9
License
ISC
Repository
github
Last release
8 years ago

a-union

Creates the union of the passed-in arrays

Install

$ npm install --save a-union

Examples

var union = require('a-union');

union([1, 2, 3], [4, 2, 1], [2, 11])
//=> [1, 2, 3, 4, 11]

union(['a', 'a', 'b', 'a'], ['c', 'a', 'd'])
//=> ['a', 'b', 'c', 'd']

While combining arrays the order of elemnets are remaied same as the arrays in argument. For example,

union([1, 2, 3, 4, 4, 5, 1, 6], [1, 9, 8])
//=> [1, 2, 3, 4, 5, 6, 9, 8]

Usage

require('a-union')( *array )

Return union of the passed-in arrays, in-order.

Arguments:

  • *array: sequence of arrays

Returns: Return a new array containing union of all the array elements passed.

License

© 2016 vikram. MIT License