Chunky Monkey not passing tests

Tell us what’s happening:
Hello. Can someone either give me a hint or tell me what’s wrong with this code? I come up with the correct results, but it is not passing any of the tests.

Your code so far

function chunkArrayInGroups(arr, size) {
  // Break it up.
  var count = 0;
  for (var i = 0; i < arr.length; i+=size) {
    newArray.push(arr.slice(count, count+size));
    count += size;
  }
  return newArray;
}
chunkArrayInGroups(["a", "b", "c", "d", "e"], 2);

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36.

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

Have you solved this yet? You forgot to declare a newArray variable.

I think I goofed when I did copy/paste. I do have var newArray=[]; on line 1. Any other ideas? Thanks!

I moved my newArray variable from outside the function to inside the function, and it passed. Thanks @kevcomedia for taking the time to look at my code.