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 trialLuis Paulino
Courses Plus Student 1,779 PointsLike this?
I edited this answer, but I know something still f# up.
function returnValue(anything){
return anything;
}
var echo= 'returnValue();'
<!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>
4 Answers
Kieran Black
9,139 PointsHi Luis,
You are close, but currently you are assigning a string of 'returnValue();' to the variable echo, instead you want to call the function and provide a string as the argument, the return value of the returnValue() method will then be stored in the variable.
function returnValue(anything) {
return anything;
}
var echo = returnValue('string here');
Hope that helps
KB
Steven Parker
231,236 PointsThere should have been a hint with the challenge test response. Did you get this response:
Bummer! It doesn't look like you passed a string (characters inside quote marks) to the returnValue()
method like this: returnValue('hello')
.
Also, the quotes they put around the answer aren't meant to be part of the answer. So your actual answer would look something like this:
var echo = returnValue('hello');
Luis Paulino
Courses Plus Student 1,779 PointsYeah Steven, but it was still a bit confusing.
Kieran Black
9,139 PointsYou're welcome
Russell Sawyer
Front End Web Development Techdegree Student 15,705 PointsYou are pretty close. You need to pass a string into the function. Also, when you call the function you don't use quotes.
function returnValue (anything) {
return anything;
}
var echo = returnValue('string');
Luis Paulino
Courses Plus Student 1,779 PointsLuis Paulino
Courses Plus Student 1,779 PointsThanks you sooo much Kieran