Skip to main content

Function: chunk()

chunk<T>(array: readonly T[], chunkSize: number): T[][]

Splits up an array into chunks

Type parameters

Type parameter
T

Parameters

ParameterTypeDescription
arrayreadonly T[]The array to chunk up
chunkSizenumberThe size of each individual chunk

Returns

T[][]

Source

lib/chunk.ts:6