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

finally,from the returnValue function return the value passed in.

script.js
function returnValue ('value') {
  var echo = 'value';
  return 'value';
}
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>

1 Answer

Piotr Manczak
Piotr Manczak
11,829 Points

Value is a parameter(variable) so it cannot be in ''. Have a look at this:

function returnValue(value) {

return value;

}