Test migration to jest by hand
Apparently using regular expressions is way easier.
This commit is contained in:
5
test/takeWhile/takeWhile.js
Normal file
5
test/takeWhile/takeWhile.js
Normal file
@ -0,0 +1,5 @@
|
||||
const takeWhile = (arr, func) => {
|
||||
for (const [i, val] of arr.entries()) if (func(val)) return arr.slice(0, i);
|
||||
return arr;
|
||||
};
|
||||
module.exports = takeWhile;
|
||||
Reference in New Issue
Block a user