Any suggested improvements? Chunky Monkey challenge

Here is my code below, i would like to see improvement suggestions if there is!

function chunkArrayInGroups(arr, size) {
  let momArr = [...arr];// momArr for Momentary Array, just a name... 
  let finalArr = [];
  while (momArr.length > 0) {
    let localArr = momArr.splice(0, size);
    finalArr.push(localArr);
  }
  return finalArr;
}

1 Like

Just checkout the other solutions and compare them to your own. You will see various ways of approaching this challenge.

1 Like