This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by Barry
over 9 years

6/17 - I keep getting an error that myArray has fewer than three rows or columns

According to the exercise, this should be a 2D array with 3 rows and three columns. I put in the following:

var newArray = [["Row 1", "Row 2", "Row 3"], ["Col 1", "Col 2", "Col 3"]];

And got an error “It looks like newArray has fewer than three rows. If I add an extra array like so:

var newArray = [["Row 1", "Row 2", "Row 3"], ["Col 1", "Col 2", "Col 3"], ["B1", "B2", "B3"]];

now I get an error “It looks like new Array has fewer than three columns. Please help!

Answer 545bb7b07c82cad3cb0002e0

3 votes

Permalink

@Barry, Your code is 100% ok.

Under certain circumstances you can shoot your Browser in an inconsistent state.

Therefor it is of an advantage to know that you have 2 reset facilities:

One is the use of the F5-key which does a refresh Browser

and

Two, select&copy your code Then use the Reset Code button of the course-window, then paste your code back in.

P.S. Try this to get ROW, COL idear right……

var newArray = [["row 1 col 1","col 2","col 3"],
                ["row 2 col 1","col 2","col 3"],
                ["row 3 col 1","col 2","col 3"]]
console.log( newArray );
points
Submitted by Leon
over 9 years

1 comments

richard walther over 9 years

thanks

Answer 546db0008c1ccc2282000e42

0 votes

Permalink

var newArray = [[“row 1 col 1”,”col 2”,”col 3”], [“row 2 col 1”,”col 2”,”col 3”], [“row 3 col 1”,”col 2”,”col 3”]] console.log( newArray );

//it works just go and check

points
Submitted by Shiva Kumar
over 9 years

Answer 548f573476b8feee3500a0f2

0 votes

Permalink

var newArray = [[“x”, “y”, “z”], [“x”, “y”, “z”], [“x”, “y”, “z”]] works too

points
Submitted by Invisibilis
over 9 years

1 comments

Mohammad Fahad about 9 years

var newArray = [[“1”, “2”, “4”], [“2”, “3”, “9”], [“2”, “3”, “7”]];

Answer 54931bc6e39efec5180058f5

0 votes

Permalink

Create a two-dimensional array called newArray in the editor. It should have three rows and three columns containing any data you like. Check the Hint if you need help!

It appears that this statement should say create a 3 dimensional array not a 2 dimensional. Each array is a dimension.

points
over 9 years

Answer 550924f195e378bdd1001074

0 votes

Permalink

var newArray = [[“1”, “2”, “4”], [“2”, “3”, “9”], [“2”, “3”, “7”]];

Jee loo apni zindageee

points
Submitted by Mohammad Fahad
about 9 years