Tell us what’s happening:
Hello. Can someone either give me a hint or tell me what’s wrong with this code? I come up with the correct results, but it is not passing any of the tests.
Your code so far
function chunkArrayInGroups(arr, size) {
// Break it up.
var count = 0;
for (var i = 0; i < arr.length; i+=size) {
newArray.push(arr.slice(count, count+size));
count += size;
}
return newArray;
}
chunkArrayInGroups(["a", "b", "c", "d", "e"], 2);
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36
.
Link to the challenge:
https://www.freecodecamp.org/challenges/chunky-monkey