Chunky monkey works put I can't pass the test

I’ve checked other solutions but I believe I have declared everything, I return the right array and everything is inside the function. I just don’t see it. Here’s the code:

···
function chunkArrayInGroups(arr, size) {
for(let index = 0; index < size; index++)
let subarr = [];
subarr.push(arr.splice(0, size));
arr.push(subarr);
}
return arr;
}
···

I can’t check right now but I suggest you use browser console or a different editor (repl.it for example) to check your output, I am not sure your code can give right solution in all cases

Do you know what the output is for all the function calls being tested?

The output is not correct for all other function calls which doesn’t surprise me but I am not passing any of the criteria which does.
I’ll work on it until they are all working and then I’ll probably pass the criteria too.

Cheers,
Karin

Just discovered enormous mistake, huge in the third function call. I now what to work on now.

you are also missing the opening curly bracket of the for loop

Anyway, I checked, these are all the outputs for the various test calls, I would say you need to fix something

[[["a","b"]],[["c","d"]]]
[[[[[0,1,2]],[[3,4,5]]]]]
[4,5,[[0,1]],[[2,3]]]
[[[[[[[4,5,[[0,1,2,3]]]]]]]]]
[[[6,[[0,1,2]],[[3,4,5]]]]]
[[[[[8,[[0,1,2,3]],[[4,5,6,7]]]]]]]
[4,5,6,7,8,[[0,1]],[[2,3]]]

Remember that with splice and push you are pushing an array in subarr, and then subarr (already multidimensional array) to an other array

let subarr = [];
subarr.push(arr.splice(0, size));
arr.push(subarr);

Ah! Of course, I couldn’t see it in my browser, too many brackets and information.
Thank you so very much for this, I got it to pass.

I used repl.it to check your code

This is an online ide? That’s what I found looking it up with google. I’ll have a look at it. Checking nested arrays in the dev tools is really hard. Thanks again.