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

Gerrad Brown
Gerrad Brown
1,497 Points

Oops! It looks like Task 1 is no longer passing.

i am just a little frustrated that it keep telling me "Oops! It looks like Task 1 is no longer passing." i know that my code is in the right area...but maybe im missing something. please help me with this.

script.js
function returnValue(drinks){
 var echo=returnValue();
  return drinks;
}
returnValue(pipsi);
index.html
<!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

Matthew Long
Matthew Long
28,407 Points

You're close. You probably misread step two. It wasn't asking you to modify the function. Also, your parameter pipsi is not a string. Don't forget quotes.

function returnValue(arg) {
  return arg;
}

var echo = returnValue('Hello world!');
Gerrad Brown
Gerrad Brown
1,497 Points

thank you very much for your help!! It worked!!