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 Objects Object Basics Create an Object

Isaiah Gadson
Isaiah Gadson
6,398 Points

challenge task 1 of 2 declare a variable named addy and assign it an empty object literal.

const person = { name: 'addy' }; I declared my variable, but it's coming back as wrong.What did I do wrong?

2 Answers

Cameron Childres
Cameron Childres
11,817 Points

Hi Isaiah,

You've declared a variable named person and assigned it an object with a property of name and a value of 'addy'.

Instead, the challenge wants you to "declare a variable named addy and assign it an empty object literal". To declare addy you would type const addy, and an empty object literal looks just like an empty pair of curly braces: {}. The result looks like this:

const addy = {};

Hope this helps! Let me know if you have any questions.

Isaiah Gadson
Isaiah Gadson
6,398 Points

it works! thanks for the help.