Skip to content

Welshman Docs / @welshman/lib / chunk

Function: chunk() ​

chunk<T>(chunkLength, xs): T[][]

Defined in: packages/lib/src/Tools.ts:868

Splits array into chunks of specified length

Type Parameters ​

• T

Parameters ​

chunkLength ​

number

Maximum length of each chunk

xs ​

T[]

Array to split

Returns ​

T[][]

Array of chunks