Clarify _.uniq docs. [ci skip]

This commit is contained in:
jdalton
2015-03-30 00:55:30 -07:00
parent 2edcc89303
commit 64bfed2640

View File

@@ -5750,12 +5750,13 @@
}); });
/** /**
* Creates a duplicate-value-free version of an array using `SameValueZero` * Creates a duplicate-free version of an array, using `SameValueZero` for
* for equality comparisons. Providing `true` for `isSorted` performs a faster * equality comparisons, in which only the first occurence of each element
* search algorithm for sorted arrays. If an iteratee function is provided it * is kept. Providing `true` for `isSorted` performs a faster search algorithm
* is invoked for each value in the array to generate the criterion by which * for sorted arrays. If an iteratee function is provided it is invoked for
* uniqueness is computed. The `iteratee` is bound to `thisArg` and invoked * each element in the array to generate the criterion by which uniqueness
* with three arguments: (value, index, array). * is computed. The `iteratee` is bound to `thisArg` and invoked with three
* arguments: (value, index, array).
* *
* If a property name is provided for `iteratee` the created `_.property` * If a property name is provided for `iteratee` the created `_.property`
* style callback returns the property value of the given element. * style callback returns the property value of the given element.
@@ -5783,8 +5784,8 @@
* @returns {Array} Returns the new duplicate-value-free array. * @returns {Array} Returns the new duplicate-value-free array.
* @example * @example
* *
* _.uniq([1, 2, 1]); * _.uniq([2, 1, 2]);
* // => [1, 2] * // => [2, 1]
* *
* // using `isSorted` * // using `isSorted`
* _.uniq([1, 1, 2], true); * _.uniq([1, 1, 2], true);