mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 15:57:48 +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) {
|
||||
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