Why is it that I keep getting a type error with trying to create a 2-d array?

Tell us what’s happening:
I keep getting “TypeError: Cannot set property ‘0’ of undefined”.

Your code so far

function chunkArrayInGroups(arr, size) {
  var newArr = [];
  var subArr = 0;
  var x = 0;
  for (var i = 0; i < arr.length; i++) {
    newArr[subArr][x] = arr[i];
    if (newArr.length == size) {
      subArr = subArr + 1;
      x = 0;
    x = x + 1;
  return newArr;

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

Your browser information:

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

Link to the challenge:

newArr has been declared as an array (empty) but newArr[0][0] is not declared as an array. It doesn’t even exist until you put something there. That’s why you are getting the error message.

Writing directly to array indices is going to very difficult. There were two clues included in the instructions to that problem that will help you - links to the array methods .push() and .slice(). Slice will help you cut given array into smaller pieces and push will help you put those smaller arrays into a single larger array.