15. Multidimensional arrays


#1








    Save & Submit Code



Reset Code

var myObj = new Object ();
var newArray = [[1, 3],[5, myObj],[6, 7]];

when i try this it gets an error please help.

Oops, try again.
It looks like your first two rows are the same length. Make them different!

#2

Hey @do_while! Add like a colum to either your first or second row. So like var myNewArray [[1, 3 ,2],[5, myObj],[6, 7]];


#3

thanks, i got it already but still thank for your response


#4

For anyone else looking at this for help:


#5

what will be its output it doesn't show any output.


#6

Nothing because there is no console.log or anything being used.


#7

with this code

var blubb = new Object();
blubb.name = "Derek";
var test = [ [blubb, true], [123, 67, 'hey', "what's up", false] ];

I get the same error.


#8

Kay, problem solved.
the array is supposed to be named "newArray"


#9

make it different as

var newArray = [[1, 3],[5, 6,myObj],[6,4,9, 7]];


#10

var myObj={
Name:"Pavithra",
Age:27,
Property:"None"
}
mewArray=[[1,5],[4,90],[myObj,4,5,6,8]];

It s also giving the same error like"Oops, try again. It looks like your first two rows are the same length. Make them different!

What is the wrong


#11

var myObj={
Name:"Pavithra",
Age:27,
Property:"None"
}
var newArray=[[1,5],[myObj,4,5,6,8]];


#12

it doesn't f****** work


#13

guys i seriously need help i just cant seem to define arrays


#14

i have a problem with my arraysbecause itkeeps sayinhg error


#15


#16


#17


#18