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 trialEmma Back
3,119 PointsCall a function with return value
Hi!
I can't seem to solve this problem - tried it many different ways! Please help! :)
/E
function returnValue( holler ) {
return holler;
var echo = return;
}
returnValue('Hello' + 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>
2 Answers
Daniel Languiller
Full Stack JavaScript Techdegree Graduate 33,396 PointsYou had the first part right. The next part of the challenge wants you to make a new variable, and assign its value to the call of that function. Passing in string to the function. Something like this.
function returnValue( holler ) {
return holler;
}
var echo = returnValue("Example");
Emma Back
3,119 PointsTHANK YOU! Helped a lot :) Absolutely gonna mark it as best answer Aakash Srivastav
Aakash Srivastav
Full Stack JavaScript Techdegree Student 11,638 PointsThanks , All the best . Keep coding :)
Aakash Srivastav
Full Stack JavaScript Techdegree Student 11,638 PointsAakash Srivastav
Full Stack JavaScript Techdegree Student 11,638 PointsIt's nice to see you here Daniel Languiller . That's a nice explanation :) Hey Emma Back , if you got you answer , must mark this genius guy's answer as "Best Answer" .