What's wrong with my code?


#1


Link to my exercise: https://www.codecademy.com/en/courses/javascript-beginner-en-9Sgpi/2/4?curriculum_id=506324b3a7dffd00020bf661#
please help if you spot something off in my code, I'm stuck on this for the past few days and trying to get past it, can't see what's going wrong.

Codeacademy is giving me the following error: SyntaxError: Unexpected token ';'. Expected '}' to end a object literal.


var object1 = {
    name:"Arjun";
};

var object2 = new Object();
object2["name"] = "ArjunT";

var object3 = {
    name:"ArjunTa";
};


#2

remove those ";" for object1 and object3. The last property for literal notation do not end with ";". Since you only have 1 property in those objects, that property is the first and the last in the object.


#3

Thanks so much! you helped me work out the problem...I didn't get what it was asking me to do XD


#4

Haha no problem! Usually those errors mean wrong placement of symbols or unclosed brackets, etc.


#5

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