Basic JavaScript - Passing Values to Functions with Arguments

Tell us what’s happening:
Describe your issue in detail here.
Why is this not Working ?

*Pls ignore if posted again

Your code so far

function functionWithArgs(variableOne,variableTwo) {
  console.log(variableOne = variableTwo);
}

functionWithArgs(22,2)

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0

Challenge: Basic JavaScript - Passing Values to Functions with Arguments

Link to the challenge:

It’s not working because you didn’t type what the instructions asked you to type? :upside_down_face:

Seriously though, it’s easier to help if you are more specific about what is confusing for you.

What part of the instructions does this line do?

Create a function called functionWithArgs that accepts two arguments and outputs their sum to the dev console.

I think it’s trying to do this part but I don’t understand what the = is for

I think the function is supposed to be something like this

Mod Edit: SOLUTION REMOVED

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

1 Like

Truly ignorance has no defense :sweat_smile::pray:. I was not aware.

Any inconvenience caused is sincerely regretted.

1 Like

Tell us what’s happening:
Describe your issue in detail here.
The code is not passing

Your code so far

function functionWithArgs(variableOne,variableTwo) {
  console.log(variableOne = variableTwo);
}

functionWithArgs(22,2)

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0

Challenge: Basic JavaScript - Passing Values to Functions with Arguments

Link to the challenge:

You are not outputting the sum of the two parameters as per the instructions.

You still have this =. What is it doing? = Isn’t how to add two numbers together

Just copy paste the Code here (the solution)

I cannot write the answer for you. That’s not allowed

Ok thank you very much

I don’t know if you are still stuck but I just solved this. your function needs to be told to add those two numbers together both 1 and 2 and 7 and 9. You can’t just tell it to add 1+2 though because then it ceases to work when you attempt to add 7+9.
So look at your code and see where you can identify what is, for example, param1 and param2.
Then where can you identify that you need to add param1 and param2.
Lastly, an area where you can modify param1 and param2 without modifying the original function.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.