1
|
var baseFlatten = require('./_baseFlatten'),
|
2
|
baseRest = require('./_baseRest'),
|
3
|
baseUniq = require('./_baseUniq'),
|
4
|
isArrayLikeObject = require('./isArrayLikeObject');
|
5
|
|
6
|
/**
|
7
|
* Creates an array of unique values, in order, from all given arrays using
|
8
|
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
9
|
* for equality comparisons.
|
10
|
*
|
11
|
* @static
|
12
|
* @memberOf _
|
13
|
* @since 0.1.0
|
14
|
* @category Array
|
15
|
* @param {...Array} [arrays] The arrays to inspect.
|
16
|
* @returns {Array} Returns the new array of combined values.
|
17
|
* @example
|
18
|
*
|
19
|
* _.union([2], [1, 2]);
|
20
|
* // => [2, 1]
|
21
|
*/
|
22
|
var union = baseRest(function(arrays) {
|
23
|
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
|
24
|
});
|
25
|
|
26
|
module.exports = union;
|