SyntaxError


#1

var object1 {
name: "Jack",
age: 22
};

var object2 = new.Object();
object2['name'] = "Jack";
object2.age = 22;

var object3 = new.Object();
object3['currentlydoing'] = "coding";
object3.time = "forever";
object3['case'] = "no one knows";

it says: SyntaxError: Unexpected token {

does anybody has a clue y?


#2

var object1 {   // add a = after object1 
 name: "Jack",
 age: 22
};

var object2 = new.Object(); // delete the dot
object2['name'] = "Jack";
object2.age = 22;

var object3 = new.Object(); // delete the dot
object3['currentlydoing'] = "coding";
object3.time = "forever";
object3['case'] = "no one knows";

#3

with the dots i realized right after i posted it, but with =, oh man! anyway thanks a lot, gonna improve soon, promise :smiley:


#4

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