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

Justin Townsend
Justin Townsend
4,335 Points

JavaScript function and return

I am confused, it looks right to me but it's wrong, and I don't know why

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

Looks like you misread what the second part was asking.

The echo variable should be called after the end of the returnValue function, i.e. echo will have the result of calling returnValue.