SyntaxError: Unexpected identifier


#1


Here is what I have

var bool = true;
Obj myObj = new Obj();

var myArray = [11, bool, "string", myObj()];


I keep getting the unexpected identifier error.


#2

well Obj is not an identifier in this case for Obj myObj. instead var needs to be used to get myObj = new Obj(); also Object needs to be written out in every place you have Obj unless your using myObj. Hopefully that will help! :smiley:


#3

that worked, thanks!


#5

6 posts were split to a new topic: Having a problem with this one


#6