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 trialKaran Paul Chaudhary
Full Stack JavaScript Techdegree Student 1,369 Pointsnot executing
function returnValue(drink){ var echo = 20+drink; return echo+"please"; } console.log(returnValue("coffee"));
function returnValue(drink){
var echo = 20+drink;
return echo+"please";
}
console.log(returnValue("coffee"));
<!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
Ari Misha
19,323 PointsHiya there! You're not doing what challenge asked you to do. Always stick to the instructions given in the challenge. Now regarding the challenge, task one wants you to create function named returnValue
which takes a single argument. ANd you simply have to return this argument that was passed in to the function.
In task 2, you've to assign the result of reurnValue()
to a variable named echo. This is how implemented my code:
function returnValue (drink) {
return drink;
}
var echo = returnValue("coffee");
Steven Parker
231,236 PointsDon't change the function you make in task 1. The code done for task 2 will go after the function and will use the function to get the value to assign to the new variable echo.