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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Shen JIE LIN](https://uploads.teamtreehouse.com/production/profile-photos/1113722/micro_headshot.jpg)
Shen JIE LIN
10,612 PointsJavaScript Objects
On 'andrew' and 'ryan', set the 'greet' method as the 'genericGreet' function.
var genericGreet = function() {
return "Hello, my name is " + this.name;
}
var andrew = {
name: "Andrew",
greet: genericGreet.call(andrew)
}
var ryan = {
name: "Ryan",
greet: genericGreet.call(ryan)
}
this does not work
I have also tried just
greet: genericGreet()
greet: genericGreet.apply(ryan)
and it still does not work.
however, it seems to be working in the chrome console window,
someone help figure out why it is not working out in the challenge?
1 Answer
![Chris Malcolm](https://secure.gravatar.com/avatar/97f2c21a84fd6ec63a45b8d298444240?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Chris Malcolm
2,909 PointsI think if you remove the parenthesis it worked for me
greet: genericGreet
Shen JIE LIN
10,612 PointsShen JIE LIN
10,612 PointsI just tried it, it still doesn't work.
that is pretty weird that it lets you pass but not me then :S
Shen JIE LIN
10,612 PointsShen JIE LIN
10,612 Pointsgave it a break, came back, and did the samething again, and it passed, LOL.