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 trial

JavaScript JavaScript Basics (Retired) Creating Reusable Code with Functions Passing an Argument to a Function

Setting variables to equal function results?

function returnValue(height) {
 return height; 
  var echo = getReturnValue();

I've also tried, just returnValue(); height(); returnValue; height; getHeight(); nothing works and just keep getting told I didn't set the variable echo to the results of the function returnValue().

1 Answer

You are so close, but what you need to do is move your variable outside of the function you created.

function returnValue(height) {
 return height; 
 var echo = returnValue('68');

I hope this helps.