12. Practice makes perfect


#1

I get the error SyntaxError: missing } after property list every time i run this and i don't know why


var object2 = {
    hello: "hello";
}

var object3 = {
    language: "English";
}
var object1 = new Object();
object1["PC"] = "Custom";


#2

Hey there.

You have put a semi-colon after your literal notation properties. There's no need to do this here.
If you wish to have multiple properties you should separate them with a comma instead.

e.g.

var object2 = {
    hello: "hello";
}

Should look like

var object2 = {
    hello: "hello"
}

If you wish to add another property

var object2 = {
    hello: "hello",
    anotherProperty: "property value"
}

#3

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