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 JavaScript Basics (Retired) Creating Reusable Code with Functions Review Creating Reusable Code with Functions

Jonathan Pearson
PLUS
Jonathan Pearson
Courses Plus Student 6,704 Points

I'm having trouble with this one question on the quiz

Finish the code below, so that the function returns the message variable:

function greeting( name ) {
var message = "Hello " + name;
;

}

I know i should start out with return but i'm not sure what i should put after. I've tried message, hello + name and a few others. I'm just lost.

3 Answers

Jeremy Faith
PLUS
Jeremy Faith
Courses Plus Student 56,696 Points

Matt is right except the quiz already has a semicolon inserted in the form. Just type return message and it should work.

Jonathan Pearson
Jonathan Pearson
Courses Plus Student 6,704 Points

I can't believe I missed that! It was killing me, I kept thinking I was doing something wrong. Thanks so much!

matt hunter
matt hunter
13,165 Points

Try return message; but remember to put a semicolon after it.

Jonathan Pearson
Jonathan Pearson
Courses Plus Student 6,704 Points

Hey Matt thanks for replying! Unfortunately that didn't work.