Corrected collate function
This commit is contained in:
parent
f69ad38910
commit
bfc9b3b1b3
1 changed files with 1 additions and 1 deletions
|
@ -25,7 +25,7 @@ function collate(array, rows = 2) {
|
|||
let row = [];
|
||||
array.forEach((value, index) => {
|
||||
row.push(value);
|
||||
if (index % rows === 0) {
|
||||
if ((index + 1) % rows === 0) {
|
||||
collatedArray.push(row);
|
||||
row = [];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue