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 Passing an Argument to a Function

Why don't they publish answers?

I have not had any problems up to now. This time I am completely stuck. I have tried to figure out the answer to this challenge question with no luck for 2 days.

I don't know how to do this part: "Set the value of echo to be the results of calling the returnValue function. When you call the returnValue function, make sure to pass in any string you'd like for the parameter." What does this mean?

It's annoying that Treehouse does not publish the answers to questions. If I could see the answer I could at least learn something by working backwards and figure it out on my own. Thanks for your help

script.js
function returnValue (hello) {
  return hello;
}
index.html
<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>

4 Answers

William Li
PLUS
William Li
Courses Plus Student 26,868 Points

Hi Ron Redmond ,

You assign value to a variable by using the = sign, and on the right of the assignment operator, you need to call the returnValue function and pass in ANY string of your choice as function argument.

var echo = returnValue("any string");

Like such.

Hi Ron, I also share your sentiment about Treehouse not allowing you to see the answer, especially after a certain amount of unsuccessful attempts at least displaying a prompt asking if you want to see the solution. I suspect the lack of answers is to help foster a sense of community through this forum, but I think that it still doesn't seem like the best set-up.

Thanks for your input. I think you're right. Glad to know I'm not the only one who would like to have the answers.

My code doesn't seem to pass until I comment out the previous code above it from the previous exercise. Very strange.

This was a friction point for me also.

It may be useful to have a pop-up dialogue box that directs you to the forums, after x amount of unsuccessful tries (If community support is the desire) .

Other than that I am loving the course!