Multidimensional arrays


#1


https://www.codecademy.com/en/courses/javascript-beginner-en-9Sgpi/3/2?curriculum_id=506324b3a7dffd00020bf661


Hi all !

I'm feeling a bit dumb right now but I can't make this code work. I keep having this message : SyntaxError: Invalid shorthand property initializer

Could someone please help ? Thanks a lot ! Cheers !


var object1 = {
    key1 = 'house',
    key2 = 'garden'
};

var newArray = [[1, 4, 2],[object1]];


#2

after the keys, you should have colons

given you use the literal notation, see here


#3

Oh my god... I feel so stupid..

Thanks a lot four your answer ! :smiley:


#4

#5

you mixed up literal notation and object constructor, it happens, no need to feel stupid