Chunky Monkey solution feedback

Tell us what’s happening:
So I have an approach where I try to solve the problems on my own but I’d like to have some feedback on this solution as it isn’t really like those suggested in the hint section. I’m not really sure what is supposed to happen if you enter the size of 0 but I just solved it by not accepting 0 or lower.

Thanks for any feedback.

Your code so far

function chunkArrayInGroups(arr, size) {
  // Break it up.
  var newArray = [];
  var start = 0;
  
  if (size <= 0) // to stop it from infinite loop
    {
      console.log("input positive digit 1-9");
      return null;
    }
  
  for (var i=0;i<arr.length/size;i++)
    {
      newArray[i] = arr.slice(start,start+size);
      start = start+size;
      
    }


  
  return newArray;
}

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

Link to the challenge:
https://www.freecodecamp.org/challenges/chunky-monkey

At this stage when you are learning, if it works then it works. :+1:
Say “well done” and move on.