Skip to main content

partition

partition<T, A, B>(l, partitioner): object

Partitions a list into two lists - one for which the supplied partitioner returns true (the left list), and the other, the right list, for which the supplied partitioner does not return true.

Type Parameters

T

T

A

A

B

B

Parameters

l

ArrayLike<T>

List to partition

partitioner

(candidate) => boolean

Function to use to partition the list.

Returns

object

left

left: A[]

right: B[]