source: trip-planner-front/node_modules/lodash/union.js@ 8d391a1

Last change on this file since 8d391a1 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 749 bytes
Line 
1var 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 */
22var union = baseRest(function(arrays) {
23 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
24});
25
26module.exports = union;
Note: See TracBrowser for help on using the repository browser.