Appearance
chunk
For a given sequence, divide it into chunks of a given size and group them into arrays.
Example
chunk([1, 2, 3, 4, 5], 3) // => [[1, 2, 3], [4, 5]]
Link
Playground
const { chunk } = require('rhodash') chunk([1, 2, 3, 4, 5], 3) // => [[1, 2, 3], [4, 5]]