Syntax
chunk('<collection>', <length>)Examples
chunk('abcdefghij', 4)['abcd', 'efgh', 'ij']
chunk(createArray(1, 2, 3, 4, 5), 2)[[1, 2], [3, 4], [5]]
Maker notes
- Handy for sending items to an API in batches.
Splits a string or an array into pieces of a set length.
chunk('<collection>', <length>)chunk('abcdefghij', 4)['abcd', 'efgh', 'ij']
chunk(createArray(1, 2, 3, 4, 5), 2)[[1, 2], [3, 4], [5]]