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 trialAnthony c
20,907 PointsTask 2/2
what does this mean?
"Assign your name to the fullName property on the contact object literal."
var contact = [];
3 Answers
Grace Kelly
33,990 PointsHi Anthony, it means you need to assign a property name of "fullName" to the contact object literal and give it a value of your name, for example:
var contact = {
fullName : "Grace Kelly"
};
Note: also I think you have incorrectly declared the object literal, it needs two curly brackets {}, not []
eli d
Courses Plus Student 2,510 Pointsvar contact = new Object(); contact.fullName = "John Doe";
what about ?
eli d
Courses Plus Student 2,510 Pointswhat about this?
var contact = new Object();
contact.fullName = "John Doe";
danheffernan
10,004 Pointsdanheffernan
10,004 PointsThe first task of this exercise asks you to make an empty object literal:
var contact = {};
The second task is too add a fullName property with the value of your name. The syntax for that looks like this: