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

Modify the returnValue function to accept one argument named value. NEED HELP

PLEASE HELP WHAT AM I MISSING OR NOT DOING> IVE BEEN STUCK FOR HOURS

script.js
function returnValue(Value) {
  return Value;
}

var echo = returnValue("Value");
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>

4 Answers

Takuya Hirata
Takuya Hirata
23,292 Points

Hello Jasmine, I think it is supposed to be "value" not "Value". Hope this works

Did this work for you? Having same trouble.

Heba Hendy
Heba Hendy
4,822 Points

function returnValue (value) { returnValue; }

Takuya Hirata
Takuya Hirata
23,292 Points

What kind of error did you get?

I just figured it out, thank you. Was stuck on this for a bit.

function returnValue(value) { return value; }

var echo = returnValue("value");

//this worked for me