main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
747 bytes
|
Rev | Line | |
---|
[d565449] | 1 | import baseFlatten from './_baseFlatten.js';
|
---|
| 2 | import baseRest from './_baseRest.js';
|
---|
| 3 | import baseUniq from './_baseUniq.js';
|
---|
| 4 | import isArrayLikeObject from './isArrayLikeObject.js';
|
---|
| 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 | export default union;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.