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

Crisoforo Gaspar Hernández
Crisoforo Gaspar Hernández
18,302 Points

Wrong answer

When you write the answer with some sort of space after the value for the key on the object the answer is mark as a wrong answer.

James Barnett
James Barnett
39,199 Points

It's hard for us to know help with any issue you are having if you don't show us your code. For some tips on how to do that, check out the tips for asking questions video located in the right hand sidebar.

1 Answer

Dave McFarland
STAFF
Dave McFarland
Treehouse Teacher

Can you give a code example? I've added spaces and even broken the object definition over multiple lines without problem:

var me = {
        name: 'Dave' 
      };
var me = { name: 'Dave', age: 100};

If the object has more than one key, don't forget to add a comma after the value for the first key, but NOT after the second key.

Crisoforo Gaspar Hernández
Crisoforo Gaspar Hernández
18,302 Points

Thank you for your answer this seems weird because I had the same answer as your first answer but it was mark as wrong, but when I reload the browser the same cut/paste answer (my answer which was previous mark as wrong) was mark as correct.

By the way thank you for the feedback.