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 Object-Oriented JavaScript (2015) Introduction to Methods Create an Object Literal

how to create a literal object and assign it to a variable with no property value

how to create a literal object and assign it to a variable with no property value?

object.js
var contact = {
  phone: 0;
}

1 Answer

andren
andren
28,558 Points

You might be overthinking this challenge a bit, they are essentially just asking you to create an empty object and to set it to a variable called contact. Objects are created using {} so the solution to the first task is simply this:

var contact = {}