[**@bondsports/general**](../README.md) • **Docs**

***

[@bondsports/general](../globals.md) / partition

# Function: partition()

> **partition**\<`T`\>(`array`, `predicate`): [`T`[], `T`[]]

Partitions an array into two arrays based on a predicate.
inspired by lodash.partition

## Type Parameters

• **T**

## Parameters

• **array**: `T`[]

The array to partition.

• **predicate**

The predicate to use to partition the array.

## Returns

[`T`[], `T`[]]

A tuple of two arrays, the first containing the items that satisfy the predicate, the second containing the items that do not satisfy the predicate.

## Defined in

[utils/array.util.ts:125](https://github.com/Bond-Sports/bondUtils/blob/545f16ceb055481acfd7641d7809c0f252d3a5e6/packages/general/src/utils/array.util.ts#L125)
