UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

10 lines (8 loc) 266 B
function dropWhile(arr, canContinueDropping) { const dropEndIndex = arr.findIndex((item, index, arr) => !canContinueDropping(item, index, arr)); if (dropEndIndex === -1) { return []; } return arr.slice(dropEndIndex); } export { dropWhile };