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 trialRaedawn Long
6,943 Pointssuggestions on returnvalue not reading variable
variables and returnvalue
function returnValue (str) {
var echo
return str;
}
alert("echo");
returnValue ('echo');
<!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
Antonio De Rose
20,885 Pointsfunction returnValue (str) {
var echo //this is not where you've been asked to store, so you can delete this line
return str;
}
alert("echo"); // this is not needed, you will have to only action against the question
returnValue ('echo'); //this is where you have been asked to store with the echo variable
Jeffery Haupt
Python Development Techdegree Student 18,938 PointsJeffery Haupt
Python Development Techdegree Student 18,938 PointsYou seem to have the right mindset here, but you just need to change some of the order of your code:
Is what I did to complete the code challenge. You are declaring "var echo" in the function. You should move this outside the function and have it tied to your returnValue ("echo"); statement. You can then delete the alert line as well.