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