Tell us what’s happening:
Describe your issue in detail here.
Your code so far
function functionWithArgs(a, b) {
console.log(a + b)
}
functionWithArgs(1, 2);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36
Challenge: Passing Values to Functions with Arguments
Link to the challenge:
Hello there.
Do you have a question?
If so, please edit your post to include it in the Tell us what’s happening section.
Learning to describe problems is hard, but it is an important part of learning how to code.
Also, the more information you give us, the more likely we are to be able to help.
Hi @lamab3056 !
I have formatted your code for better readability.
In the freeCodeCamp editor, you can right click and choose format document.
As to your question, you don’t need multiple function calls.
The code you wrote is correct.
The reason why you don’t need multiple function calls is because behind the scenes, freeCodeCamp is already making multiple function calls for you.
If you are curious, here are the tests for this particular challenge
Hope that clears it up.
In the future, please make sure to fill out this section here
As the challenges increase in difficulty, you will have to provide more details for the issue you are having so we can help you
i’am able to do (1,2) = 3
but i could add the (7, 9)
You could write something like this and the test will still pass
function functionWithArgs(a, b) {
console.log(a + b)
}
functionWithArgs(1, 2);
functionWithArgs(7, 9);
but you don’t need to at all.
You don’t need to add extra function calls for each test case.
The test is taking your code here
function functionWithArgs(a, b) {
console.log(a + b)
}
and making this function call functionWithArgs(7, 9);
behind the scenes for you.
That is why you don’t need to add it to your code.
Hope that is clearer
system
Closed
7
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.