Chunky Monkey cant understand why my code is not working

Tell us what’s happening:

Here is my solution to the Chunky Monkey challenge.

It solves half of the examples given. I have followed the algorithm but cannot see any flaws in the logic.

Your code so far

function chunkArrayInGroups(arr, size) {
  // Break it up.
  var count = 0;
  var arrNew = []; 
  var arrFin = [];
for ( var i = 0; i < arr.length ; i += size) {
  arrNew = arr.slice(i , size + size  * count );
  count =+ 1;
  return arrFin;

chunkArrayInGroups([0,1,2,3,4,5,6], 3);

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36.

Link to the challenge:

I don’t know that operator exist, maybe you mean +=

1 Like

Thank you. That fixed the issue with the logic flow that I was tearing my hair about. It shows that having someone proof read my code is always worthwhile. Cant believe I did not spot that.

1 Like