a-partition
Splits an array into two parts if given predicate satisfied
Install
$ npm install --save a-partition
Example
var arrayPredicate = ; console; // -> [ [ 0, 2, 4 ], [ 1, 3, 5 ] ] console; // -> throw new Error('predicate value required');
require('a-partition')(list, callback)
Arguments:
list
: list be the single arraycallback
: callback be the predicate that will be executed on each element of array
Returns: Returns an array having two array first contains elements which satisfies the predicate and other which don't
License
© 2016 Vikram Jadhav. MIT License