Test migration to jest by hand
Apparently using regular expressions is way easier.
This commit is contained in:
9
test/partition/partition.js
Normal file
9
test/partition/partition.js
Normal file
@ -0,0 +1,9 @@
|
||||
const partition = (arr, fn) =>
|
||||
arr.reduce(
|
||||
(acc, val, i, arr) => {
|
||||
acc[fn(val, i, arr) ? 0 : 1].push(val);
|
||||
return acc;
|
||||
},
|
||||
[[], []]
|
||||
);
|
||||
module.exports = partition;
|
||||
Reference in New Issue
Block a user