Objects: Putting it all together


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;


Your error is here:

For literal notation, you use

instead of

Happy Coding :slight_smile:


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