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 trialTiffany White
5,373 PointsNot sure what I am being asked to do here.
Not sure what they're asking here. Use the programming from printFullName. I cut the programming and add it to contact and add a fullName variable to the contact object literal but that doesn't work. Not sure what to do?
function printFullName() {
var firstName = "Andrew";
var lastName = "Chalkley";
console.log(firstName + " " + lastName);
}
var contact = {
var fullName
}
1 Answer
Jason Anders
Treehouse Moderator 145,860 PointsHey Tiffany,
Andrew wants a method created on the object contact in Task 1. So basically all the code that is the function will be moved into contact
as a method called fullName like so...
var contact = {
fullName: function printFullName() {
var firstName = "Andrew";
var lastName = "Chalkley";
console.log(firstName + " " + lastName);
}
}
If you want, you can review this starting at ~1:00 in this video.
Keep Coding!