Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Foundations Objects Basic Objects

Unexpected string error on my object key.

I followed Jim's example of having a Key with a space needing to be surrounded by quotes.

var Lukas = { 
    name: "Lukas", 
    skills: ["JavaScript", "Ruby", "Dancing"]
    "favorite color": "Green"
};

The console gives me the error when it gets to the line that reads "favorite color": "Green"

I can't seem to figure out why this is an issue? I'm overlooking something , I'm sure of it!

Thanks in advance,

Lukas

2 Answers

Hi Lukas,

I think your only issue is that you're missing a comma at the end of your array for "skills"

Similar to how you have a comma at the end of "Lukas".

Each property/value pair should be separated with a comma.

Aha! I knew I was overlooking something.

Thank you kindly for your swift response!