mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 15:27:50 +00:00
Rename var initFromArray to initFromCollection in _.reduce and _.reduceRight.
This commit is contained in:
12
lodash.js
12
lodash.js
@@ -6610,10 +6610,10 @@
|
||||
* // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
|
||||
*/
|
||||
function reduce(collection, iteratee, accumulator) {
|
||||
var initFromArray = arguments.length < 3;
|
||||
var initFromCollection = arguments.length < 3;
|
||||
return (typeof iteratee == 'function' && isArray(collection))
|
||||
? arrayReduce(collection, iteratee, accumulator, initFromArray)
|
||||
: baseReduce(collection, getIteratee(iteratee, 4), accumulator, initFromArray, baseEach);
|
||||
? arrayReduce(collection, iteratee, accumulator, initFromCollection)
|
||||
: baseReduce(collection, getIteratee(iteratee, 4), accumulator, initFromCollection, baseEach);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -6637,10 +6637,10 @@
|
||||
* // => [4, 5, 2, 3, 0, 1]
|
||||
*/
|
||||
function reduceRight(collection, iteratee, accumulator) {
|
||||
var initFromArray = arguments.length < 3;
|
||||
var initFromCollection = arguments.length < 3;
|
||||
return (typeof iteratee == 'function' && isArray(collection))
|
||||
? arrayReduceRight(collection, iteratee, accumulator, initFromArray)
|
||||
: baseReduce(collection, getIteratee(iteratee, 4), accumulator, initFromArray, baseEachRight);
|
||||
? arrayReduceRight(collection, iteratee, accumulator, initFromCollection)
|
||||
: baseReduce(collection, getIteratee(iteratee, 4), accumulator, initFromCollection, baseEachRight);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user