"Make sure at least one of the elements in one of your rows is an object."


#1

//I can't figure out why I'm getting this error message

var myObj = new Object();
myObj.name = "Sarah";

var myArray = [[2,2,2],["fun", "times",], [myObj]];


#2

You can help us by letting us know which lesson this is... 14 or 15?


#3

15:
Arrays and Objects in JS
Multidimensional arrays
Good! Now let's create a 2D array. Not only that, but a 2D array that's jagged. Remember, that means it's an array of arrays, and its nested arrays aren't all the same length! For example:

var aList = [ [1, 4, 2], [7] ];
Instructions
Make an array called newArray. It should be 2D (that is, it should contain two elements that, in turn, are arrays) and jagged (those two arrays should be of different lengths, like in the example above).

The ultimate kicker? Make one of your inner arrays contain an object!


#4

Yours has three rows, when it should only have two. Note that the middle row in your example has an extra comma. Remove one of the rows, then test it with this:

console.log(myArray[1][0].name);    // Sarah