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 trialRoscoe Coney
13,124 PointsIm DROWNING in this question!! plz help
QUESTION:
Now that you've created the returnValue function, call it, by passing it a literal string value -- a series of characters in quote marks like this: 'My argument'. Store the results of the function in a variable named echo.
I have below:
function returnValue (car) {
var echo = "My argument"
return (car)
}
2 Answers
Matthew Ong
6,041 PointsYou need to return the argument passed into the function, not a defined string. You are also missing a few semicolons. This should work:
function returnValue (car) {
return (car);
}
var echo = returnValue('hello');
Roscoe Coney
13,124 PointsI tried that and I received the following error message
Bummer! To call a function type its name and a pair of parentheses like these returnValue('hello')
.
Matthew Ong
6,041 PointsOh it wants you to actually call the function. I've updated my answer, try it now.
Roscoe Coney
13,124 PointsPerfect!! Thanks, I see what I did wrong!
Richard Duncan
5,568 PointsRoscoe Coney Hi! If you're satisfied with the answer it's good practice to mark it as 'best answer' to encourage help in the future and also should any student struggle with this themselves they will have a reference to it :)
MUZ140875 Joseph Chivasa
7,758 Pointsfunction returnValue(a){ return a;} var echo = "returnValue("a")";
i keep getting it wrong
zabe sangary
2,657 PointsYou doing it wrong totally. Advise you to watch the video over and over.
function returnValue(a){ return (a); }
var echo = returnValue("Much to learn still have.");
Shilpa K
12,722 PointsShilpa K
12,722 PointsIf you can correct your markup for it to be easier to read, that would be helpful. But already I can see that you need to put an " = " to assign your variable var echo, not " - "