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

Levente Bito
Levente Bito
4,679 Points

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

I need help with this task

script.js
function returnValue(anything){
return anything
var echo
}
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>

2 Answers

Steven Parker
Steven Parker
231,236 Points

:point_right: Just follow the instructions carefully:

  • it says to create the variable "After your newly created returnValue function" (not inside it!)
  • then "set the value" (create an assignment with "=")
  • then "call the returnValue function" (something like returnValue("here's my string");)
Skyler Fowler
Skyler Fowler
881 Points

Steven Parker, how is that helpful? You gave no advice, only stating what has already been stated. Good one...slow clap

Steven Parker
Steven Parker
231,236 Points

Skyler Fowler, sometimes it's quite helpful for students to see the instructions broken down into smaller steps, as I have done here. Also, my breakdowns emphasize the areas in which the work already done diverged from the task requirements, calling attention to where remediation is required. And additionally, I have included hints and an example snippet as guidance towards the solution. Furthermore, I have not diminished the potential learning value of the exercise by providing an outright spoiler.

If have an alternative answer that you feel might be even more helpful, you are always welcome to post it. But I think the one you posted here falls short of being helpful itself.