mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Fixin missing accumulator return in reduce and predicate call in partition.
This commit is contained in:
@@ -25,7 +25,7 @@ import reduce from './reduce.js'
|
|||||||
*/
|
*/
|
||||||
function partition(collection, predicate) {
|
function partition(collection, predicate) {
|
||||||
return reduce(collection, (result, value, key) => (
|
return reduce(collection, (result, value, key) => (
|
||||||
result[key ? 0 : 1].push(value)
|
result[predicate(value) ? 0 : 1].push(value), result
|
||||||
), [[], []])
|
), [[], []])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user