I'm returning the correct array values, but it says I'm not. Could this be because of the extra white space being returned?

Tell us what’s happening:

Your code so far


function chunkArrayInGroups(arr, size) {
let finalArr = [];
let currentArr = [];
let currentIndex = 0
for (let i = 0; i < Math.ceil(arr.length / size); i++) {
  currentArr = [];
  for (let j = 0; j < size; j++) {
    currentArr.push(arr[currentIndex]);
    currentIndex++;
  }
  finalArr.push(currentArr);
}
let filteredFinalArr = [];
for (let i = 0; i < finalArr.length; i++) {
currentArr = finalArr[i].filter(x => x !== undefined);
filteredFinalArr.push(currentArr);
}
console.log(filteredFinalArr);
// return finalArr;
}

chunkArrayInGroups(["a", "b", "c", "d", "e", "f", "g"], 3);

Your browser information:

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

Challenge: Chunky Monkey

Link to the challenge:

your function doesn’t seem to return anything, do you have a return statement?