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 trialThomas Cormier
2,496 PointsQUIZ HELP
I am stuck on the second part of this quiz. I have no idea what I am doing wrong and the quiz hints do not help at all. It also keeps "timing out" every time I submit my answer. I have to copy past my code:
function returnValue (breakfast) { var echo = (breakfast); return breakfast; } returnValue ('eggs');
2 Answers
Jennifer Nordell
Treehouse TeacherEcho is a variable to be declared outside the function. The value of echo will be the string you pass to the function.
Take a look at my example:
function returnValue(myValue) {
return myValue;
}
var echo = returnValue("This works! YAY!");
We initialize a variable echo outside of the function by calling the function and then sending it a string. That string is now assigned to the variable echo.
When your challenge times out, click on the X to close the window. Don't click either of the two buttons offered. Then run check work again.
Thomas Cormier
2,496 PointsThank you both!!!
Jennifer Nordell
Treehouse TeacherYou're welcome! :)
Tushar Singh
Courses Plus Student 8,692 PointsTushar Singh
Courses Plus Student 8,692 PointsFirst You have to create a function that returns the value that you pass in the function(argument) and then store it in a variable called "echo".