1
0
mirror of https://github.com/kremalicious/umami.git synced 2024-12-24 02:06:19 +01:00
umami/lib/array.js

12 lines
197 B
JavaScript
Raw Normal View History

2020-09-13 10:26:54 +02:00
export function chunk(arr, size) {
const chunks = [];
let index = 0;
while (index < arr.length) {
chunks.push(arr.slice(index, size + index));
index += size;
}
return chunks;
}