Passing Values to Functions with Arguments i need help

Tell us what’s happening:

help me here guys i need to solve this task

Your code so far

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

// Only change code below this line.
function functionWithArgs(){
  console.log(1+2);
  console.log(7+9);
}
functionWithArgs(1,2);//Outputs 3
functionWithArgs(7,9);//Outputs 16


Your browser information:

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

Link to the challenge:
https://www.freecodecamp.org/challenges/passing-values-to-functions-with-arguments

You need to follow the instruction.

  1. Create a function called functionWithArgs that accepts two arguments and outputs their sum >to the dev console.
  2. Call the function.

It says that it needs to output the sum of the arguments. Notice the example:

function ourFunctionWithArgs(a, b) {
  console.log(a - b);
}

This outputs the difference of the arguments. So, you need almost the exact same things as this, but it should have the new function name and instead of the difference it should output the sum.

2 Likes