What is the Syntax error for? Can anyone help?


#1

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

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


var object1=new Object();
object1.type="fancy";
object1.id=12;
var myArray=[[object1],[1,3,5]];


#2

Your code looks fine...It outputs 12 here at my end...check once again


#3

var object1=new Object();
object1.type="fancy";
object1.id=12;
var myArray=[[object1],[1,3,5]];

above is your code, and below is code which works in editor

var object1=new Object();
object1.type="fancy";
object1.id=12;
var myArray=[1, true, 'a', object1];

give it a shot.


#4

I got the problem little late. Actually they asked to define an array with name 'newArray' and I had given it as 'myArray'. Nothing else was prob


#5

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