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

SURENDRA MALLA
SURENDRA MALLA
3,727 Points

After your newly created returnValue function, create a new variable named echo. Set the value of echo to be the results

what is the solution? After your newly created returnValue function, create a new variable named echo. Set the value of echo to be the results from calling the returnValue function. When you call the returnValue function, make sure to pass in any string you'd like for the parameter.

The function will accept the string you pass to it and return it back (using the return statement). Then your echo variable will be set with what is returned, the results.

Steven Parker
Steven Parker
229,786 Points

Please give it your best "good faith" attempt, and then post your code if you still need hep. Please also post a link to the course page you are working with.

4 Answers

Steven Parker
Steven Parker
229,786 Points

You're really close, but you need to pass only a literal string when you call your function. There are no variables defined outside the function itself at this point that you can refer to (such as "xyz").

var echo = returnValue("Just testing!");
SURENDRA MALLA
SURENDRA MALLA
3,727 Points

Steven you just inspired me to get back on the problem, your list of completed courses are longer than the lines of codes that i have ever written! let me see if i can fix it one more time. i'll get back to you soon.

Steven Parker
Steven Parker
229,786 Points

Good luck, and just post your code (and a link) if you're still stuck.

SURENDRA MALLA
SURENDRA MALLA
3,727 Points

cant do it ... function returnValue(xyz) { return xyz; } var echo = returnValue( xyz + "you like");

SURENDRA MALLA
SURENDRA MALLA
3,727 Points

i actually did it.. function returnValue(xyz) { return xyz } var echo = returnValue("what ever " + "you like");

Steven Parker
Steven Parker
229,786 Points

Good job, and extra credit there for performing a concatenation! :+1:

But just as a general rule, don't do anything the instructions don't ask for. In the more complicated challenges it can confuse the validation mechanism.