Tell us what’s happening:
Any feedback would be highly appreciated.
**Your code so far**
function chunkArrayInGroups(arr, size)
let slicedArr = [];
for (let i = 0; i <= arr.length; i++){
slicedArr.push(arr.splice(0, size));
}
if(arr.length >= 1) {
slicedArr.push(arr);
}
else {
return slicedArr;
}
// console.log(slicedArr);
return slicedArr;
}
chunkArrayInGroups([0, 1, 2, 3, 4, 5], 4);
**Your browser information:**
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.192 Safari/537.36
.
Challenge: Chunky Monkey
Link to the challenge: