Split xs into consecutive slices of length size. The last slice may be shorter if the length isn't divisible.
xs
size
Dual API — works data-first or curried for use in pipe.
pipe
RangeError if size is not a positive integer (fractional, zero, or negative values all reject).
chunk([1, 2, 3, 4, 5], 2) // [[1, 2], [3, 4], [5]] Copy
chunk([1, 2, 3, 4, 5], 2) // [[1, 2], [3, 4], [5]]
Split
xsinto consecutive slices of lengthsize. The last slice may be shorter if the length isn't divisible.Dual API — works data-first or curried for use in
pipe.