How to make it two dimensional?


#1


https://www.codecademy.com/en/courses/javascript-beginner-en-9Sgpi/1/2?curriculum_id=506324b3a7dffd00020bf661


When I run my code the console prints:" [ [ 1, 1, 1 ], [ 2, 2, 2 ], [ 3, 3, 3 ] ] "
How can I make that it looks two dimensional(in Rows)?


Replace this line with your code. 

var newArray = 
[
[1, 1, 1],
[2, 2, 2],
[3, 3, 3]
];
console.log(newArray);


#2

you could use a for loop? You try to build it, great challenge :slight_smile: If you need more help, let me see how you attempted the loop, i will help you further


#3

ok thanks I will try


#4

I could make it ! Thanks
But why does the for Loop worked and the normal console.log not?


#5

well done. Because print prints everything to one line.


#6

ou ok thanks very much


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.