Isn't this 2D array?


The message keeps saying that "It looks like newArray has fewer than two rows. Your array should be 2D! "
But I don't know where I get wrong.
Please help ~~

var newArray=[ ["Emily","Jim","Yu"],["chocolate","banana"] ];
var Jim={
    nationality: "Korea",


Which it is. Perhaps humor the lesson checker and add a third row. White space is permitted and actually makes it easier to read...

var newArray = [
    ["Emily", "Jim", "Yu"],
    ["chocolate", "banana"],
    [0, 1, 1, 2, 3, 5, 8]


Have tried adding the third row....still doesn't work. :sob:


A link to the lesson, please.


I tried to add another row myself, didn't work. So I just copy and paste your code, still doesn't work.


It looks like this lesson is not expecting the object. Try commenting that out or removing it, then run the code again.

Your intial code almost passes when only the array is present and logged out.

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

Here's something to try... Move the object definition to the top, and remove the quotes from "Jim" in the list.


Thank you for helping! It works this way!


for future reference...

var Jim = {
    nationality: "Korea",
    Age: 28
var newArray = [
     ["Emily", Jim, "Yu"],
     ["chocolate", "banana"]


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