mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-26 20:39:07 +01:00
12 lines
197 B
JavaScript
12 lines
197 B
JavaScript
|
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;
|
||
|
}
|