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 iterable into chunks of given size. 🏃 📼 📦 🌔
iterable.chunk(x, [n]); // x: an iterable // n: chunk size (1)
const iterable = require('extra-iterable'); var x = [1, 2, 3, 4, 5]; [...iterable.chunk(x, 2)]; // [ [ 1, 2 ], [ 3, 4 ], [ 5 ] ] [...iterable.chunk(x, 3)]; // [ [ 1, 2, 3 ], [ 4, 5 ] ]