Objects: Putting it all together


#1

I keep getting "There was a problem with your syntax," and it would print out as "SyntaxError: Invalid shorthand property initializer." Help

var snoopy = {
species = "beagle",
age = 10
};

var buddy = new Object();
buddy.species = "golden retriever";
buddy.age = 5;


#2

Your error is here:

For literal notation, you use

instead of

Happy Coding :slight_smile:


#3

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