Chunks the elements of an Iterable.
Behavior for negative chunkSize is not defined.
chunkSize
Chunk in pairs
const makePairs = chunk(2);const pairs = makePairs([1,2,3,4,5]);console.log(pairs); // [[1,2], [3,4], [5]]
concat, flatMap, pairwise and zip for similar operations.
The chunked Iterable
the Iterable value type
Generated using TypeDoc
Chunks the elements of an Iterable.
Remarks
Behavior for negative
chunkSizeis not defined.Example
Chunk in pairs
See
concat, flatMap, pairwise and zip for similar operations.
Returns
The chunked Iterable