Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 953 Bytes

README.md

File metadata and controls

17 lines (12 loc) · 953 Bytes

@unction/partition

Tests Stability Dependencies

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]]