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 trialMarwan Solh
2,057 PointsTask 2 of of Passing in argument in a function task
I keep getting "Oops! It looks like Task 1 is no longer passing." for Task Two. I can't figure out what I did wrong. Here is the code:
function returnValue(fox) {
return fox;
}
var echo returnValue("dragon");
function returnValue(fox) {
return fox;
}
var echo returnValue("dragon");
<!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
Andreas Nyström
8,887 PointsHi!
You forgot one small little thing. Other than that everything looks fine. So:
var echo returnValue("dragon");
Should be:
var echo = returnValue("dragon");
So what happened was that you just forgot an equal sign. Hope this helps. :)
Jennifer Nordell
Treehouse TeacherHi there! You're doing fantastic! Would it be comforting to know that you're off by literally one character? The challenge is asking you to assign the result of running that function to the variable echo
. You set up var echo
and then you called the function, but you forgot the assignment. Remember, we use the equals sign =
to do an assignment. In your last line, there should be an equals sign, but I'll leave the placement up to you.
The reason you're receiving the "Task 1 is no longer passing" is because the omission of the equals sign is causing a syntax error and your code can no longer be interpreted.
Hope this helps!
Marwan Solh
2,057 PointsThank you very much :) I can't believe I missed that
Marwan Solh
2,057 PointsMarwan Solh
2,057 Pointsahhh, silly me. Thank you very much!
Andreas Nyström
8,887 PointsAndreas Nyström
8,887 PointsNot silly at all! Happens to everyone every day :)!