Assitance on creating an argument

Tell us what’s happening:

  **Your code so far**

function functionWithArgs(a,b) {
console.log(a+b);
}
functionWithArgs(1,2); /=3
functionWithArgs(7,9); /=16
functionWithArgs(3,16)
  **Your browser information:**

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 13421.89.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36.

Challenge: Passing Values to Functions with Arguments

Link to the challenge:

1 Like

Did you have a question here? Your code is fine.

Unless of course you are really including the /=3. I’m assuming that is supposed to be a comment and thus should be double forward slashes.

1 Like

this is a syntax error and your code stops executing, and the tests don’t even check your code
if you want a comment you need to start with //

1 Like

On the chance you are trying to say: Take the return value of the function and then make that equal to itself divide by n, e.g., functionWithArgs(1,2) /= 3, that would not work for multiple reasons as your function has no return value (it will return undefined ) so the outcome of that process would return NaN or it would if you first assigned a variable to the return value of the function, but in this case it throw an error as you cannot reassign undefined

console.log(undefined /= 3 === NaN) // throws an error 
//(It does not throw an error in my browser console, 
//but it really should, and it will in the FCC console)
1 Like

you’re missing the strict mode that fcc has active I think
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode

2 Likes