[Basic Algorithm Scripting: Chunky Monkey] Function returns correct arrays but doesn't pass the tests

Hi all,

I came up with the following code which - as per console - returns the correct arrays.

However, none of the tests is passed. Can anyone tell my why?

function chunkArrayInGroups(arr, size) {
  // Break it up.

  let tArr = [[]];
  let j = 0;
  let k = 0;

  for (let i = 0; i < arr.length; i++) {
    if (j >= size) {
      k ++;
      j = 0;
    tArr[k][j] = arr[i];
  return arr;

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

Kind Regards

You’re returning the original array (arr) rather than tArr :wink:

Oh gee - it’s early in the morning. :smiley:

Thank you very much! I even double checked if I properly return arr:roll_eyes: