Let’s break down the instructions.
Create a function called functionWithArgs that accepts two arguments
When you create the function here, you need to add two parameters.
You can call those parameters whatever you want to.
Parameters are just placeholders for the real values when you call the function later on.
But the parenthesis cannot be empty here.
If you need help creating parameters, then you can look at the example code again.
//Here is a function with two parameters, param1 and param2:
function testFun(param1, param2) {
Here is the second part of the directions.
and outputs their sum to the dev console.
Inside your function you need to console.log the sum of those two parameters.
Here is the last part of the directions.
Call the function with two numbers as arguments.
You did that part right.
What you need to do is fix is the actual creation of the function.
The correct answer should only be 4 lines of code.
Just copying what the challenge is asking you to do isn’t quite the same thing as telling me what you are confused about. Without additional knowledge I’d just repeat the example that the challenge has. If you tell me what specific part of the instructions or examples don’t make sense though, then I can help explain in more depth.
I’ve included parameters in the parenthesis, however the code won’t run.
I’ve kept the same name “functionWithArgs” for both (1,2) and (7,9) but the code only works when i change one of them to “ourFunctionWithArgs”.
I agree with @JeremyLT that you should write your new code in the forum so we can see what is going on because there is still some misunderstanding on your end.
When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.