Initial commit
[yaffs-website] / node_modules / grunt-contrib-watch / node_modules / lodash / array / union.js
1 var baseFlatten = require('../internal/baseFlatten'),
2     baseUniq = require('../internal/baseUniq'),
3     restParam = require('../function/restParam');
4
5 /**
6  * Creates an array of unique values, in order, from all of the provided arrays
7  * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
8  * for equality comparisons.
9  *
10  * @static
11  * @memberOf _
12  * @category Array
13  * @param {...Array} [arrays] The arrays to inspect.
14  * @returns {Array} Returns the new array of combined values.
15  * @example
16  *
17  * _.union([1, 2], [4, 2], [2, 1]);
18  * // => [1, 2, 4]
19  */
20 var union = restParam(function(arrays) {
21   return baseUniq(baseFlatten(arrays, false, true));
22 });
23
24 module.exports = union;