UNPKG

bbo

Version:

bbo is a utility library of zero dependencies for javascript.

18 lines (13 loc) 317 B
'use strict'; /** * 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; } module.exports = dropWhile;