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


#1

var newArray
var myObj = {
type: 'fancy',
disposition: 'sunny'
};
var aList = [[1,4,2], [7]];
myArray = [myObj], [aList];

Instructions
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


#2

Help anyone i dont get this @amanuel2 @albionsrefuge


#3

You have created the array that the exercise is asking for:

var newArray

but you haven't put anything in it yet.

Did you want to take a run at that?


#4

var newArray = [myObj], [aList];
var myObj = {
type: 'fancy',
disposition: 'sunny'
};
var aList = [[1,4,2], [7]];
myArray = [myObj], [aList];


#5

You are getting closer!

You can't use myObj or aList before you define them. The JS interpreter is reading your code from the top down. When it reads line 1 it doesn't know abouit myObj or aList yet.

Don't forget that your array must be enclosed in [ ].


#6

So what do i need to do in order for it to work


#7

Move your var newArray AFTER your var myObj and var aList.


#8

var myObj = {
type: 'fancy',
disposition: 'sunny'
};
var aList = [[1,4,2], [7]];
myArray = [myObj], [aList];
var newArray = [myObj], [aList];

New Code

Now it says
There was a problem with your syntax.


#9

To simplify this, how about if you delete this line that you aren't using:

myArray = [myObj], [aList];

Now, let's focus on this line:

var newArray = [myObj], [aList];

Remember that your array must be surrounded with [ ] - your's is not.


#10

It stilll says
There was a problem with your syntax.


#11

Keep showing me what you've done with your code.


#12

Here is the new code
`var myObj = {
type: 'fancy',
disposition: 'sunny'
};
var aList = [[1,4,2], [7]];

var newArray = [myObj], [aList];`


#13

The only way that JavaScript understands that you have an array is if you put [ ] around it.

var newArray = [ two other arrays in here ];

#14

Now we are having a whole differnt problem
`var myObj = {
type: 'fancy',
disposition: 'sunny'
};
var aList = [[1,4,2], [7]];

var newArray = [myObj, aList];`

It looks like the first element in newArray isn't an array.


#15

It doesn't recognize anything as an array unless you put [ ] around it. myObj by itself is not an array.


#16

when i do that we go back to the beginning and to the original problem


#17

Show me what you've done.


#18

OK
`var myObj = {
type: 'fancy',
disposition: 'sunny'
};
var aList = [[1,4,2], [7]];

var newArray = [myObj], [aList];`


#19

Yep, you've gone back to the beginning again.

Come back to this step:

You need to create one array and put two other arrays inside it.

Leave the [ ] that are already there, they are defining the newArray array. That is your one big array.

Put new [ ] just around myObj. That will give you the first inside array.
aList is already an array so it doesn't need anything added - no [ ] for it.


#20

Code
`var myObj = {
type: 'fancy',
disposition: 'sunny'
};
var aList = [[1,4,2], [7]];

var newArray = [myObj], aList];`

Now it is saying Unexpected token ]