Cleanup docs for _.drop, _.pick, _.countBy, _.groupBy, and _.sortBy.

Former-commit-id: 0dc89937d067c996fd28b585f42c1e01e928441b
This commit is contained in:
John-David Dalton
2012-08-26 11:41:17 -07:00
parent 4bdf28059a
commit 6465f8d8e6

View File

@@ -1129,12 +1129,19 @@
* @alias omit * @alias omit
* @category Objects * @category Objects
* @param {Object} object The source object. * @param {Object} object The source object.
* @param {Object} [prop1, prop2, ...] The properties to drop. * @param {Function|String} callback|[prop1, prop2, ...] The properties to drop
* or the function called per iteration.
* @param {Mixed} [thisArg] The `this` binding for the callback.
* @returns {Object} Returns an object without the dropped properties. * @returns {Object} Returns an object without the dropped properties.
* @example * @example
* *
* _.drop({ 'name': 'moe', 'age': 40, 'userid': 'moe1' }, 'userid'); * _.drop({ 'name': 'moe', 'age': 40, 'userid': 'moe1' }, 'userid');
* // => { 'name': 'moe', 'age': 40 } * // => { 'name': 'moe', 'age': 40 }
*
* _.drop({ 'name': 'moe', '_hint': 'knucklehead', '_seed': '96c4eb' }, function(value, key) {
* return key.charAt(0) == '_';
* });
* // => { 'name': 'moe' }
*/ */
var drop = createIterator(dropIteratorOptions); var drop = createIterator(dropIteratorOptions);
@@ -1783,13 +1790,19 @@
* @memberOf _ * @memberOf _
* @category Objects * @category Objects
* @param {Object} object The source object. * @param {Object} object The source object.
* @param {Function|String} [callback|prop1, prop2, ...] The properties to pick * @param {Function|String} callback|[prop1, prop2, ...] The properties to pick
* or the function called per iteration. * or the function called per iteration.
* @param {Mixed} [thisArg] The `this` binding for the callback.
* @returns {Object} Returns an object composed of the picked properties. * @returns {Object} Returns an object composed of the picked properties.
* @example * @example
* *
* _.pick({ 'name': 'moe', 'age': 40, 'userid': 'moe1' }, 'name', 'age'); * _.pick({ 'name': 'moe', 'age': 40, 'userid': 'moe1' }, 'name', 'age');
* // => { 'name': 'moe', 'age': 40 } * // => { 'name': 'moe', 'age': 40 }
*
* _.pick({ 'name': 'moe', '_hint': 'knucklehead', '_seed': '96c4eb' }, function(value, key) {
* return key.charAt(0) != '_';
* });
* // => { 'name': 'moe' }
*/ */
var pick = createIterator(dropIteratorOptions, { var pick = createIterator(dropIteratorOptions, {
'top': 'top':
@@ -1912,8 +1925,8 @@
* @memberOf _ * @memberOf _
* @category Collections * @category Collections
* @param {Array|Object|String} collection The collection to iterate over. * @param {Array|Object|String} collection The collection to iterate over.
* @param {Function|String} callback The function called per iteration or * @param {Function|String} callback|property The function called per iteration
* property name to count by. * or property name to count by.
* @param {Mixed} [thisArg] The `this` binding for the callback. * @param {Mixed} [thisArg] The `this` binding for the callback.
* @returns {Object} Returns the composed aggregate object. * @returns {Object} Returns the composed aggregate object.
* @example * @example
@@ -2028,8 +2041,8 @@
* @memberOf _ * @memberOf _
* @category Collections * @category Collections
* @param {Array|Object|String} collection The collection to iterate over. * @param {Array|Object|String} collection The collection to iterate over.
* @param {Function|String} callback The function called per iteration or * @param {Function|String} callback|property The function called per iteration
* property name to group by. * or property name to group by.
* @param {Mixed} [thisArg] The `this` binding for the callback. * @param {Mixed} [thisArg] The `this` binding for the callback.
* @returns {Object} Returns the composed aggregate object. * @returns {Object} Returns the composed aggregate object.
* @example * @example
@@ -2288,8 +2301,8 @@
* @memberOf _ * @memberOf _
* @category Collections * @category Collections
* @param {Array|Object|String} collection The collection to iterate over. * @param {Array|Object|String} collection The collection to iterate over.
* @param {Function|String} callback The function called per iteration or * @param {Function|String} callback|property The function called per iteration
* property name to sort by. * or property name to sort by.
* @param {Mixed} [thisArg] The `this` binding for the callback. * @param {Mixed} [thisArg] The `this` binding for the callback.
* @returns {Array} Returns a new array of sorted elements. * @returns {Array} Returns a new array of sorted elements.
* @example * @example