You guys are super helpful and I thank you again. I was working on this problem:
I successfully solved the problem, but once again, I found my solution deviated from recommended solutions. Here is mine:
function chunkArrayInGroups(arr, size) {
let loop =[...arr]
let ans = []
for(let i = 0; i < arr.length/size; i++){
ans.push(loop.splice(0, size))
}
return ans;
}
console.log(chunkArrayInGroups([0, 1, 2, 3, 4, 5], 2))
Can someone speak to my code regarding formalities and efficacy?