bbo
Version:
bbo is a utility library of zero dependencies for javascript.
16 lines (12 loc) • 300 B
JavaScript
/**
* Removes elements in an array until the passed function returns true.
* Returns the remaining elements in the array.
*/
function dropWhile(arr, func) {
var _arr = arr;
while (_arr.length > 0 && !func(_arr[0])) {
_arr = _arr.slice(1);
}
return _arr;
}
export default dropWhile;