Chunky Monkey - Having problem with this challenge

Tell us what’s happening:
I’m trying to solve this challenge with the code below but it’s not working. No of the tests are passing and when I run it the window hangs. Please have a look and tell me what’s wrong with it?

Your code so far

function chunkArrayInGroups(arr, size) {
  // Break it up.
  var new_arr = [];
  while(arr.length > size) {
    var An_array = [];
    for(var i = 0; i < size; i++) {
    arr.slice(0, size);
  var arr1 = [];
  for(var j = 0; j < arr.length; j++) {

  return new_arr;

chunkArrayInGroups(["a", "b", "c", "d"], 2);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36.

Link to the challenge:

You have created an infinite loop here.

1 Like

whenever i try to run your code my mouse turns in a colourfull spinning ball and doesn’t stop.

I think I did a mistake with Slice and Splice. I mean ‘Slice’ should be replaced with ‘Splice’.