Licence
SEE LICENSE IN LICENSE
Version
9.13.0
Deps
4
Size
24 kB
Vulns
0
Weekly
0
@unction/partition
PredicateFunctionType => Array | Set | Record<string | number | symbol, B> | Map<B, A> | string => [Array | Set | Record<string | number | symbol, B> | Map<B, A> | string, Array | Set | Record<string | number | symbol, B> | Map<B, A> | string]
This function takes an enumerable and returns an Array of two enumerables. The first of which contains elements which satisfy the predicate, the second of which contains element which do not.
partition(isOdd)([1,2,3,4]) // [[1,3],[2,4]]