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 trialToni Hammond
13,730 Pointshelp! I need to modify the return value in Task #2 in Javascript, I have been stuck for hours what am i doing wrong guys
not sure what to do next :(
function returnValue(beans) {
return "beans";
}
var echo = returnValue('beans');
<!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
Paidamoyo Maria Nalube
6,682 PointsThis worked for me
function returnValue(value){ return value; } var echo = returnValue(1);
Steven Parker
231,275 PointsTask 2 says "Modify the returnValue function to accept one argument named value." But this function's argument is named "beans" instead.
Then, task 3 says "Finally, from the returnValue function return the value passed in." But this function is returning the constant string "beans" instead of the passed argument.
Fix those and you should pass the challenge. And it doesn't look like you need to create a new "echo" variable or call the function for this challenge.
Toni Hammond
13,730 PointsThank you very much!
Steven Parker
231,275 PointsToni Hammond — Glad to help. You can mark a question solved by choosing a "best answer".
Happy coding!