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!
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
Eric Kidwell
12,280 PointsStage 6 Objects > Methods Code Challenge
I've tried about 10 different ideas and I have a feeling it's just something silly that I'm missing. Please help!
It's asking : "on 'andrew' and 'ryan', set the 'greet' method as the 'genericGreet' function.
Here's where I'm at now
var genericGreet = function() {
return "Hello, my name is " + this.name;
};
var andrew = {
name: "Andrew",
greet: genericGreet
};
var ryan = {
name: "Ryan"
greet: genericGreet
};

Eric Kidwell
12,280 PointsIt's because of the parentheses :D They're not needed.
2 Answers

John W
21,558 Pointscomma

Eric Kidwell
12,280 PointsWow, I think that signifies that it's time for bed. Thanks :)

Molly Dopheide
11,083 Pointsif it helps I did the same thing. I kept thinking 'why is the greeting: not turning green?'
Daniel Dropik
705 PointsDaniel Dropik
705 PointsOut of curiosity, why is it incorrect to say:
greet: genericGreet()
or
greet: genericGreet();