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: