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

bhupendra rana
PLUS
bhupendra rana
Courses Plus Student 5,610 Points

function greeting( name ){var message="Hello "+ name;----------;}Q. how does function return message value???? Help plea

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

Q. how does the fucntion returns the messge vlaue?

2 Answers

Antony .
Antony .
2,824 Points

Also when asking a question please use the title as your inquiry and the description for anything else you need to include. Here I'll add a reference to the Markdown Cheatsheet to format your code in the description area. https://teamtreehouse.com/community/howto-guide-markdown-within-posts

Antony .
Antony .
2,824 Points

Use the return statement at the end of the function. It should look like this:

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