[SOLVED] Chunky Monkey challenge clarification

[SOLVED] Chunky Monkey challenge clarification
0

#1

Tell us what’s happening:
I don’t seem to know what is wrong with my code. I would appreciate any enlightenment .

Your code so far

function chunkArrayInGroups(arr, size) {
  // Break it up.
  var newArray = [];
  for(var i=0; i< arr.length; i=i+size){
    if(size <= arr.length){
      var chunk = arr.slice(i,size);
      newArray.push(chunk);
    }
    
  }
  return newArray;
}

chunkArrayInGroups(["a", "b", "c", "d"], 2);

Your browser information:

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

Link to the challenge:


#2

Take a look at the docs for .slice(). You’re using it a bit incorrectly.


#3

ok, thanks. will look up the documentation again


#4

Thanks so much, you reply did help. I was able to scale through this challenge in no time