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

do not understand what this task whats from me!

what is this task ask me to do!? Confusing

function returnValue(number){
    var echo = number; 
  return "" + echo;
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
<script src="script.js"></script>

1 Answer

Nils Kriedner
Nils Kriedner
22,768 Points

Hi Farhan,

for the first part of the challenge you are just asked to create the function with any paramenter (which you did correctly) and return the value of the parameter inside the function. For that you actually do not need the "" + that you wrote. You can just write: return number;

In the second stage you are then asked to declare a variable called echo and assign the function to it (not the parameter name). Like this:

var echo = functionName(argument);

But you have declare the variable OUTSIDE (under) the function - not inside as you did.

And the argument you pass has to be a string.

Does that help?

Let me know if you need any further assistance!

Happy coding!


PS: You can upvote my post and/or mark as "best answer" (at the bottom of my post) if it helped you. :-)