UNPKG

lenye_base

Version:

基础方法

16 lines (12 loc) 303 B
/** * 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;