main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
686 bytes
|
Line | |
---|
1 | import baseUniq from './_baseUniq.js';
|
---|
2 |
|
---|
3 | /**
|
---|
4 | * Creates a duplicate-free version of an array, using
|
---|
5 | * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
---|
6 | * for equality comparisons, in which only the first occurrence of each element
|
---|
7 | * is kept. The order of result values is determined by the order they occur
|
---|
8 | * in the array.
|
---|
9 | *
|
---|
10 | * @static
|
---|
11 | * @memberOf _
|
---|
12 | * @since 0.1.0
|
---|
13 | * @category Array
|
---|
14 | * @param {Array} array The array to inspect.
|
---|
15 | * @returns {Array} Returns the new duplicate free array.
|
---|
16 | * @example
|
---|
17 | *
|
---|
18 | * _.uniq([2, 1, 2]);
|
---|
19 | * // => [2, 1]
|
---|
20 | */
|
---|
21 | function uniq(array) {
|
---|
22 | return (array && array.length) ? baseUniq(array) : [];
|
---|
23 | }
|
---|
24 |
|
---|
25 | export default uniq;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.