6/17


#1

What do they mean by "it should have 3 rows and 3 columns."?
I keep getting an error saying that I don't have 3 columns.


#2

@jennyfan2022,

Have a look at...
https://www.codecademy.com/forum_questions/55e55b2c51b887689b000543


#3

@leonhard_wettengmx_n
Thanks! It makes so much more sense now!


#4

Tell me please.
Have you got 3 rows and 3 columns in result?


#5

yes, I have 3 rows and 3 columns.
Well, they let me pass, so I think I do


#6

You can get 3 rows if you embed three arrays in your two dimensional array. You can get 3 columns if you have three elements in each of those arrays.

For example:
var array = [[1,2,3], [4,5,6], [7,8,9]];

To check if this will produce 3 rows and 3 columns, you can use a for loop like this:
for (var i = 0; i < array.length; i++){
console.log(array[i]);
}

and it will output this:
[ 1, 2, 3 ]
[ 4, 5, 6 ]
[ 7, 8, 9 ]