# Passing Values to Functions with Arguments , Need some help to find the answer of my functionWithArgs (10,2) ? how did 10 and 2 come up?

Passing Values to Functions with Arguments , Need some help to find the answer of my functionWithArgs (10,2) ? how did 10 and 2 come up?
0

#1

Tell us what’s happening:

``````// Example
function ourFunctionWithArgs(a, b) {
console.log(a - b);
}
ourFunctionWithArgs(10, 5)
; // Outputs 5

// Only change code below this line.
function functionWithArgs(a, b) {
console.log(a + b);
}
functionWithArgs(10,2);

``````

Your Browser User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36`.

#2

Not exactly sure what you are asking. The code you entered (below) passes all the tests.

``````function functionWithArgs(a, b) {
console.log(a + b);
}
functionWithArgs(10,2);
``````

“how did 10 and 2 come up?”

What do you mean by how did 10 and 2 come up? You typed the 10 and 2 as values passed to the function called functionWithArgs.

#3

Indeed, i find the answer by searching and do browsing, but i need the explanation why the answer are 10,2 ?

#4

You could have passed any two numbers and you would have passed the challenge. You could have used any of the following and passed:

``````functionWithArgs(3,6);
functionWithArgs(100,200);
functionWithArgs(1,1);
``````

The point of the challenge was to understand how to pass values into functions and then use the argument variables to sum the two numbers passed in and return the sum.