15. multidimensional array(unexpected token [ )


not sure why i'm getting this error "SyntaxError: Unexpected token [ " .Is there something wrong in this piece of code that i have to change?

The instruction given was:
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!

here's the code:

var object=new Object();


var newArray[[3,8],[object,4]];

i'm really struck up .Please help me solve it.


Both inner arrays are still the same length. Add a couple of numbers to either array.


thanks a lot.It worked out.


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