Cleanup docs.

Former-commit-id: 346b2f7c55e3d0eb3b86f19c05fa9964f998b483
This commit is contained in:
John-David Dalton
2012-05-21 12:26:53 -04:00
parent 1da0498f74
commit cb74e45b89
3 changed files with 96 additions and 90 deletions

View File

@@ -635,11 +635,11 @@
* @returns {Array|Object} Returns the `collection`.
* @example
*
* _([1, 2, 3]).forEach(function(num) { alert(num); }).join(',');
* // => alerts each number in turn and returns "1,2,3"
*
* _.forEach({ 'one': 1, 'two': 2, 'three': 3}, function(num) { alert(num); });
* // => alerts each number in turn
*
* _([1, 2, 3]).forEach(function(num) { alert(num); }).join(',');
* // => alerts each number in turn and returns "1,2,3"
*/
var forEach = createIterator(baseIteratorOptions, {
'top': 'if (thisArg) callback = bind(callback, thisArg)'
@@ -664,6 +664,9 @@
* _.groupBy([1.3, 2.1, 2.4], function(num) { return Math.floor(num); });
* // => { '1': [1.3], '2': [2.1, 2.4] }
*
* _.groupBy([1.3, 2.1, 2.4], function(num) { return this.floor(num); }, Math);
* // => { '1': [1.3], '2': [2.1, 2.4] }
*
* _.groupBy(['one', 'two', 'three'], 'length');
* // => { '3': ['one', 'two'], '5': ['three'] }
*/