partition
v0.9.6arrow_drop_downv0.9.6
STATUS
Passing
DOWNLOADS
2
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
3 KB
Takes a predicate and a list or other `Filterable` object and returns the
1 contributor
Like
Install partition as a package?
Copied
npm i @bit/justin-capalbo.ramda.partition
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example modifieddraft
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
and packages in Bit or NPM to the example. any of the 1 million componentstoggle layout
No preview available
chevron_left
chevron_right
partition (
pred:
Function
,filterable:
) : Array
Array
Takes a predicate and a list or other Filterable
object and returns the
pair of filterable objects of the same type of elements which do and do not
satisfy, the predicate, respectively. Filterable objects include plain objects or any object
that has a filter method such as Array
.
Example
Arguments
pred:
Function
A predicate to determine which side the element belongs to.
filterable:
Array
the list (or other filterable) to partition.
Returns
Array
An array, containing first the subset of elements that satisfy the predicate, and second the subset of elements that do not satisfy.