Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript Objects Object Basics Create an Object

Isaiah Gadson
Isaiah Gadson
5,719 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
MOD
Cameron Childres
Treehouse Moderator 11,714 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
5,719 Points

it works! thanks for the help.