We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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 ] ]