UNPKG

@modern-kit/utils

Version:
16 lines (14 loc) 321 B
function partition(arr, predicate) { const truthyArray = []; const falsyArray = []; for (const item of arr) { if (predicate(item)) { truthyArray.push(item); } else { falsyArray.push(item); } } return [truthyArray, falsyArray]; } export { partition }; //# sourceMappingURL=index.mjs.map