Returns an array of takeWhile(arr, pred), dropWhile(arr, pred)
Install
$ npm install --save splitwith
Usage
const splitWith = // [[1, 2], [3, 4, 5, 6]] // array-like objects // [['a', 'b'], ['c', 'd', 'e', 'f']]
API
splitWith(arr, pred)
arr
Type: array
or array-like objects
pred
Type: function
Usage is same as https://lodash.com/docs#takeWhile
License
MIT © JIANG Di