Add default accumulator values to doc examples. [ci skip]

This commit is contained in:
John-David Dalton
2016-01-28 22:11:43 -08:00
parent ce88b120eb
commit e4c9916e17

View File

@@ -7920,7 +7920,7 @@
* *
* _.reduce([1, 2], function(sum, n) { * _.reduce([1, 2], function(sum, n) {
* return sum + n; * return sum + n;
* }); * }, 0);
* // => 3 * // => 3
* *
* _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
@@ -11589,12 +11589,12 @@
* _.transform([2, 3, 4], function(result, n) { * _.transform([2, 3, 4], function(result, n) {
* result.push(n *= n); * result.push(n *= n);
* return n % 2 == 0; * return n % 2 == 0;
* }); * }, []);
* // => [4, 9] * // => [4, 9]
* *
* _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
* (result[value] || (result[value] = [])).push(key); * (result[value] || (result[value] = [])).push(key);
* }); * }, {});
* // => { '1': ['a', 'c'], '2': ['b'] } * // => { '1': ['a', 'c'], '2': ['b'] }
*/ */
function transform(object, iteratee, accumulator) { function transform(object, iteratee, accumulator) {