I’m trying to work on this exercise but I’m stuck kind of, what am I doing wrong? Or i didn’t get the question?

# 2 Parameters and returns the sum

**ArielLeslie**#2

When you are calling your function you aren’t passing in any parameters. `x`

and `y`

are both `undefined`

. You can’t add them together because they’re not numbers. `NaN`

is “Not a Number”.

**alphaleo**#3

while I was trying to put numbers in the paramethers it was giving me a erorr,

“function addNumbers(x(2), y(2))” would this be something to work on?

**DanCouper**#5

This is where you are *defining* a function:

```
function addNumbers(x, y) {
return x + y;
}
```

This is where you are trying to *execute* that function. What you are trying to execute does not match the definition:

```
addNumbers()
```

**alphaleo**#6

I don’t get it, what am I doing wrong? in this case the output should be xy isn’t it?

**Gilbert1391**#7

When you call the function you have to set the parameters:

`addNumbers(2 + 2);`

You have defined parameters x and y for your function. These are placeholders for values you will pass into the function which will become the values of x and y. The values passed into a function are know as arguments.

For example, let’s say I have the following function:

```
function subtractNumbers(myValue1, myValue2) {
return myValue1 - myValue2;
}
```

If I want to return the result of 10 - 6, then I would call the above function with:

```
subtractNumbers(10, 6); // returns 4
```

**Gilbert1391**#11

```
function addNumbers( x + y ) {
return x + y
};
```

Here you are creating a function in which you have 2 parameters, `return x + y`

is returning the sum of these parameters. When you call the function you have to define said parameters, e.g.:

`addNumbers( 2 + 2 );`