Tweak docs for _.pull, _.pullAt, and _.remove. [ci skip]

This commit is contained in:
John-David Dalton
2014-05-04 02:10:39 -07:00
parent 8c618780b7
commit 649994464c

View File

@@ -2932,9 +2932,9 @@
} }
/** /**
* Removes elements located at the given indexes and returns an array of * Removes elements from `array` corresponding to the specified indexes and
* removed elements. Indexes may be specified as an array of indexes or as * returns an array of removed elements. Indexes may be specified as an array
* individual arguments. * of indexes or as individual arguments.
* *
* Note: Like `_.pull`, this method mutates `array`. * Note: Like `_.pull`, this method mutates `array`.
* *
@@ -2999,17 +2999,17 @@
* per iteration. If a property name or object is provided it will be used * per iteration. If a property name or object is provided it will be used
* to create a "_.pluck" or "_.where" style callback respectively. * to create a "_.pluck" or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `predicate`. * @param {*} [thisArg] The `this` binding of `predicate`.
* @returns {Array} Returns the array of removed elements. * @returns {Array} Returns the new array of removed elements.
* @example * @example
* *
* var array = [1, 2, 3, 4, 5, 6]; * var array = [1, 2, 3, 4];
* var evens = _.remove(array, function(num) { return num % 2 == 0; }); * var evens = _.remove(array, function(num) { return num % 2 == 0; });
* *
* console.log(array); * console.log(array);
* // => [1, 3, 5] * // => [1, 3]
* *
* console.log(evens); * console.log(evens);
* // => [2, 4, 6] * // => [2, 4]
*/ */
function remove(array, predicate, thisArg) { function remove(array, predicate, thisArg) {
var index = -1, var index = -1,
@@ -3637,9 +3637,9 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/** /**
* Creates an array of elements from the specified indexes, or keys, of the * Creates an array of elements corresponding to the specified keys, or indexes,
* `collection`. Indexes may be specified as individual arguments or as arrays * of the collection. Keys may be specified as individual arguments or as arrays
* of indexes. * of keys.
* *
* @static * @static
* @memberOf _ * @memberOf _