xdashReadme | API


xdash / chunk

Function: chunk()

chunk<T>(arr, size): T[][]

Creates an array of elements split into groups the length of size. If array can’t be split evenly, the final chunk will be the remaining elements.

Type parameters

T

Parameters

arr: T[]

size: number

Returns

T[][]

Source

array.ts:47