Clarify result value origin and order of intersection methods. [ci skip]

This commit is contained in:
John-David Dalton
2016-02-25 23:59:41 -08:00
parent 055fdfa0b4
commit 3b1efb635b

View File

@@ -6076,13 +6076,14 @@
/** /**
* Creates an array of unique values that are included in all given arrays * Creates an array of unique values that are included in all given arrays
* using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons. * for equality comparisons. The order of result values is determined by the
* order they occur in the first array.
* *
* @static * @static
* @memberOf _ * @memberOf _
* @category Array * @category Array
* @param {...Array} [arrays] The arrays to inspect. * @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of shared values taken from the first array provided. * @returns {Array} Returns the new array of intersecting values.
* @example * @example
* *
* _.intersection([2, 1], [4, 2], [1, 2]); * _.intersection([2, 1], [4, 2], [1, 2]);
@@ -6098,14 +6099,15 @@
/** /**
* This method is like `_.intersection` except that it accepts `iteratee` * This method is like `_.intersection` except that it accepts `iteratee`
* which is invoked for each element of each `arrays` to generate the criterion * which is invoked for each element of each `arrays` to generate the criterion
* by which they're compared. The iteratee is invoked with one argument: (value). * by which they're compared. Result values are chosen from the first array.
* The iteratee is invoked with one argument: (value).
* *
* @static * @static
* @memberOf _ * @memberOf _
* @category Array * @category Array
* @param {...Array} [arrays] The arrays to inspect. * @param {...Array} [arrays] The arrays to inspect.
* @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new array of shared values taken from the first array provided. * @returns {Array} Returns the new array of intersecting values.
* @example * @example
* *
* _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor);
@@ -6131,15 +6133,16 @@
/** /**
* This method is like `_.intersection` except that it accepts `comparator` * This method is like `_.intersection` except that it accepts `comparator`
* which is invoked to compare elements of `arrays`. The comparator is invoked * which is invoked to compare elements of `arrays`. Result values are chosen
* with two arguments: (arrVal, othVal). * from the first array. The comparator is invoked with two arguments:
* (arrVal, othVal).
* *
* @static * @static
* @memberOf _ * @memberOf _
* @category Array * @category Array
* @param {...Array} [arrays] The arrays to inspect. * @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [comparator] The comparator invoked per element. * @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of shared values taken from the first array provided. * @returns {Array} Returns the new array of intersecting values.
* @example * @example
* *
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];