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 trialShelby Smith
2,144 PointsModify the returnValue function to accept one argument named value.
I don't understand what is wrong with my code; this has been troubling me for 2 hours!!
function returnValue(Value) { return Value; }
var echo = returnValue("Value");
function returnValue(Value) {
return Value;
}
var = returnValue("Value");
<!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>
1 Answer
Steven Parker
231,275 PointsI see two different versions of the code here, the one that was entered into the challenge is missing the variable name "echo".
But the version you put in by hand is has that part correct! The only other issue is that the challenge wants you to use an argument name of "value" (with lower-case "v") but this code shows "Value" (with a capital "V").
Shelby Smith
2,144 PointsI did and i keep getting the error "The function declaration doesn't have an argument named 'value'"
so would the code be function returnValue(Value) { return Value; }
var echo = returnValue("value");
all i would have to do is have a lower case ("V")? because even that doesn't work.
the error I'm getting is "The function declaration doesn't have an argument named 'value'"
Steven Parker
231,275 PointsI would expect that exact error if you still have capital "V" instead of little "v".
Larissa Ragland
6,653 PointsLarissa Ragland
6,653 Pointsfunction returnValue(value) { }