Basic JavaScript - Passing Values to Functions with Arguments

Tell us what’s happening:
Describe your issue in detail here.
It doesn’t matter what I do I keep getting this error.

SyntaxError: unknown: Unexpected token (1:26)

1 | function functionWithArgs(1,2) {
| ^
2 | console.log(1+2);
3 | }
4 | functionWithArgs(1,2);

I’ve read through multiple tip and hints and everything suggests that this code should work. Please help.
Your code so far

function functionWithArgs(1,2) {
console.log(1+2);
}
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/116.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Passing Values to Functions with Arguments

Link to the challenge:

You don’t want to specify specific values for the arguments, you want them to be variable names so that you can then call the function with any numbers.

Again, you don’t want to use specific numbers here, you’ll want to use the variable names you decide to use in the function parameter list.

Look closely again at the example in the instructions. The variable names they are using are param1 and param2. You can choose different names to use in your code or you can even use those same names. It’s completely up to you what names to use.

Parameters go in the () when declaring a function, not argument values.

That is - use variable names, not specific numbers

Thank you so much, sometimes I just have to talk it out with someone. Talk about activating brain cells. lol

1 Like