Skip to content

chunk ​

Chunking an array. The passed size indicates the length of the chunk.

Usage ​

ts
import { chunk } from 'rattail'

chunk([1, 2, 3], 2) // return [[1, 2], [3]]

Arguments ​

ArgTypeDefaults
arrArray
sizenumber1

Return ​

Type
Array