Basic JavaScript - Passing Values to Functions with Arguments

Tell us what’s happening:
Describe your issue in detail here.
Whenever I use console.log() for both instances below the declaration, it counts the second instance correct and not the first one, unless I delete the console method from the second instance. The outputs are correct, but I’m guessing something is wrong with the syntax.
Your code so far

function functionWithArgs(a, b) {
  return a + b;
}

console.log(functionWithArgs(1, 2));

console.log(functionWithArgs(7, 9));

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5.1 Safari/605.1.15

Challenge: Basic JavaScript - Passing Values to Functions with Arguments

Link to the challenge:

Hello, this is the example that the exercise gives you:

function testFun(param1, param2) {
  console.log(param1, param2);
}

And this is your code:

function functionWithArgs(a, b) {
  return a + b;
}

Draw your own conclusions


Indeed, the result is correct. But exercise asks you to get it another way

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.