Multidimensional arrays


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]];


after the keys, you should have colons

given you use the literal notation, see here


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

Thanks a lot four your answer ! :smiley:



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