We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Breaks array into chunks of given size. 🏃 📼 📦 🌔
array.chunk(x, [n]); // x: an array // n: chunk size (1) // --> chunks
const array = require('extra-array'); var x = [1, 2, 3, 4, 5]; array.chunk(x, 2); // [ [ 1, 2 ], [ 3, 4 ], [ 5 ] ] array.chunk(x, 3); // [ [ 1, 2, 3 ], [ 4, 5 ] ]